MarekRudzki / TalkBridge

Voice translator
3 stars 2 forks source link

flexible speech_to_text #11

Open flutter-painter opened 6 months ago

flutter-painter commented 6 months ago

Hi @MarekRudzki,

Did you consider using https://pub.dev/packages/speech_to_text ? Is this something you intend to add ? If I understand, using this lib does NOT require subscription / .json file. Thus lowering the entry bar for speech to text.

What would be really convenient is to have an easy way to plug different sort of speech to text. This would allow us to use other AI models with ease, whether online on hugging face, or offline using tensorflow lite.

MarekRudzki commented 6 months ago

Hi @flutter-painter, Thanks for the idea, I will take a closer look at this package in the near future and try to implement it instead of the existing speech-to-text conversion tool.

flutter-painter commented 5 months ago

Hi @MarekRudzki, Based on commit f728720e415aa9b07e5b3795497831d61f70cd16 this is now implemented for all but windows, well done !

I tested but encountered permission error on mic It seems that speech_to_text does not prompt user for permission :

speech_to_text-6.5.0\lib\speech_to_text.dart line 259 /// Returns true if the user has already granted permission to access the /// microphone, does not prompt the user.

How about adding something like this to prompt ?

`Future<bool> checkPermission() async {

const Permission permissionMic = Permission.microphone; final status = await permissionMic.status; if (status != PermissionStatus.granted) { final newStatus = await permissionMic.request(); return newStatus == PermissionStatus.granted; } else { return true; } }`

Here is a complete example using FutureBuilder : https://github.com/weebi-com/vocal_message/blob/main/lib/src/b_record_frame_permission.dart

You might want to handle this differently or chose deliberately not to add permission_handler: ^10.0.0 to pubspec yaml