livespeechtotext 0.0.2 copy "livespeechtotext: ^0.0.2" to clipboard
livespeechtotext: ^0.0.2 copied to clipboard

Add continuous speech-to-text functionality to your Flutter apps with this powerful plugin. Capture speech from the device's microphone and convert it into real-time text. Perfect for voice-controlled [...]

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:livespeechtotext/livespeechtotext.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late Livespeechtotext _livespeechtotextPlugin;
  late String _recognisedText;

  @override
  void initState() {
    super.initState();
    _livespeechtotextPlugin = Livespeechtotext();
    _livespeechtotextPlugin.addEventListener('success', (text) {
      setState(() {
        _recognisedText = text ?? '';
      });
    });
    _recognisedText = '';
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Live Speech To Text'),
        ),
        body: Center(
          child: Column(
            children: [
              Text(_recognisedText),
              ElevatedButton(
                  onPressed: () {
                    print("start button pressed");
                    try {
                      _livespeechtotextPlugin.start();
                    } on PlatformException {
                      print('error');
                    }
                  },
                  child: const Text('Start')),
              ElevatedButton(
                  onPressed: () {
                    print("stop button pressed");
                    try {
                      _livespeechtotextPlugin.stop();
                    } on PlatformException {
                      print('error');
                    }
                  },
                  child: const Text('Stop'))
            ],
          ),
        ),
      ),
    );
  }
}
24
likes
150
pub points
79%
popularity

Publisher

verified publisherihsanberahim.com

Add continuous speech-to-text functionality to your Flutter apps with this powerful plugin. Capture speech from the device's microphone and convert it into real-time text. Perfect for voice-controlled features, transcription apps, and more. Enjoy a seamless and uninterrupted user experience with continuous speech recognition.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on livespeechtotext