Search packages, repositories and app categories

GitHub repositoryjaumard/flutter_speech_recognition

flutter_speech_recognition

jaumard/flutter_speech_recognition open-source repository details.

flutter_speech_recognition project cover
Stars
18
Forks
20
Last push (UTC)
Jan 13, 2025
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

flutter_speech_recognition

Based on rxlabz plugin

Objective C and Java Flutter plugin.

A flutter plugin to use the speech recognition iOS10+ / Android 4.1+ and MacOS 10.15+

Setup:

iOS and MacOS

Add this on your Info.plist

<key>NSMicrophoneUsageDescription</key>
<string>This application needs to access your microphone</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This application needs the speech recognition permission</string>
Android

Nothing to do :)

Usage:

//..
_speech = SpeechRecognition();

// The flutter app not only call methods on the host platform,
// it also needs to receive method calls from host.
_speech.setAvailabilityHandler((bool result) 
  => setState(() => _speechRecognitionAvailable = result));

// handle device current locale detection
_speech.setCurrentLocaleHandler((String locale) =>
 setState(() => _currentLocale = locale));

_speech.setRecognitionStartedHandler(() 
  => setState(() => _isListening = true));

// this handler will be called during recognition. 
// the iOS API sends intermediate results,
// On my Android device, only the final transcription is received
_speech.setRecognitionResultHandler((String text) 
  => setState(() => transcription = text));

_speech.setRecognitionCompleteHandler(() 
  => setState(() => _isListening = false));

// 1st launch : speech recognition permission / initialization
_speech
    .activate()
    .then((res) => setState(() => _speechRecognitionAvailable = res));
//..

speech.listen(locale:_currentLocale).then((result)=> print('result : $result'));

// ...

speech.cancel();

// ||

speech.stop();
Jimmy Aumard GitHub avatar
GitHub author

Jimmy Aumard ↗

Open source enthousiaste !

Thonon-les-Bains, FranceOfficial website ↗
LanguagesObjective-CDartJavaRubySwift

Packages published by this repository

Dependencies used

Dependency list 2 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗