Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flexible speech_to_text #11

Open
flutter-painter opened this issue Dec 10, 2023 · 2 comments
Open

flexible speech_to_text #11

flutter-painter opened this issue Dec 10, 2023 · 2 comments

Comments

@flutter-painter
Copy link
Contributor

flutter-painter commented Dec 10, 2023

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
Copy link
Owner

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
Copy link
Contributor Author

flutter-painter commented Jan 15, 2024

Hi @MarekRudzki,
Based on commit f728720 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants