azure_speech_recognition 0.0.1 copy "azure_speech_recognition: ^0.0.1" to clipboard
azure_speech_recognition: ^0.0.1 copied to clipboard

outdated

An implementation of Azure Speech Recognition Service for Flutter.

example/lib/main.dart

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

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

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  String _centerText = 'Unknown';

  @override
  void initState() {
    super.initState();
  }

Future _recognizeVoice() async {
    try {
      var text = await AzureSpeechRecognition.simpleVoiceRecognition("YOUR SUBSCRIPTION KEY", "YOUR REGION",lang: "en-EN");//await platform.invokeMethod('azureVoice');
     /* String newText =
          text.substring(text.indexOf('<') + 1, text.length - 2);*/

      print("Text: $text");
      setState(() {
        _centerText = text;
      }); 
    } on PlatformException catch (e) {
      print("Failed to get text '${e.message}'.");
    }
  }



  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              Text('TEXT RECOGNIZED : $_centerText\n'),
              FloatingActionButton(onPressed: _recognizeVoice,child: Icon(Icons.mic),),
            ],
          ),
        ),
      ),
    );
  }
}
8
likes
30
pub points
22%
popularity

Publisher

verified publishercristianbregant.it

An implementation of Azure Speech Recognition Service for Flutter.

Repository (GitHub)
View/report issues

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on azure_speech_recognition