speech_to_text_ultra_tg 0.0.7 copy "speech_to_text_ultra_tg: ^0.0.7" to clipboard
speech_to_text_ultra_tg: ^0.0.7 copied to clipboard

A modified version of the speech_to_text_ultra package to include language onlisten and update speech_to_text_package.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:speech_to_text_ultra_tg/speech_to_text_ultra_tg.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late SpeechToTextUltra2 speechService;

  @override
  void initState() {
    super.initState();
    speechService = SpeechToTextUltra2(
      ultraCallback: (liveText, finalText, isListening) {
        // print('Live Text: $liveText');
        if (finalText.isNotEmpty) {
          print(finalText);
        }
        // print('Is Listening: $isListening');
      },
      language: 'en-US',
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Speech to Text Example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  speechService.startListening();
                },
                child: Text('Start Listening'),
              ),
              ElevatedButton(
                onPressed: () {
                  speechService.stopListening();
                },
                child: Text('Stop Listening'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
150
points
87
downloads

Publisher

unverified uploader

Weekly Downloads

A modified version of the speech_to_text_ultra package to include language onlisten and update speech_to_text_package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, speech_to_text

More

Packages that depend on speech_to_text_ultra_tg