Flutter plugin for Vosk speech recognition.
Add this pro guard rules in ...android/app/proguard-rules.pro If the file does not exist create it.
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }
Add this plugin to pubspec.yaml
vosk_flutter_plugin:
ByteData modelZip = await rootBundle.load('assets/models/vosk-model-small-en-us-0.15.zip');
await VoskFlutterPlugin.initModel(modelZip);
VoskFlutterPlugin.start();
VoskFlutterPlugin.stop();
StreamBuilder(
stream: VoskFlutterPlugin.onPartial(),
builder: (context, snapshot) => Text(snapshot.data.toString()),
),
StreamBuilder(
stream: VoskFlutterPlugin.onResult(),
builder: (context, snapshot) => Text(snapshot.data.toString()),
),
StreamBuilder(
stream: VoskFlutterPlugin.onFinalResult(),
builder: (context, snapshot) => Text(snapshot.data.toString()),
),