flutter_tts
flutter_tts copied to clipboard
Using Voice class instead of Map + Including gender when available
Problem
I needed access to the underlying gender APIs provided by iOS, however it had to be done on a library level.
Changelog
- Converts Maps of voices into a proper Dart class called
TTSVoice. - Provides a somewhat reliable API for checking gender in voices from Android or iOS platforms.
I know this might not be the most elegant solution, but it does work on android and iOS devices.
Ps: I also am aware that this might be a breaking change, so it could be an opportunity to convert the library into objects instead of generic and dynamic types. 😉
great idea @CodingAleCR and thank you for this PR. I'll probably start a pre-release to version 4 and include this in that while other objects are being integrated in place of dynamics.
@dlutton When will this PR be merged ?
@theatifwaheed I intend to include this in the next major release. I want to fix a couple of more bugs, add minor enhancements, and add unit tests first. Next major release I'm hoping to include this change including other returned objects and support for Linux.
Acknowledged @dlutton I also figured 2 issues. I fixed in the https://github.com/theatifwaheed/flutter_tts Fork of this Branch.
Build.VERSION.SDK_INT < 26 Doesn't calls the function in new phones.
also, set Handlers were not working I just shifted FlutterTts _channel.setMethod... to a new function as functions were empty when constructor is called and then they are not called when setProgress or other handlers setting is called.
cc @dlutton
@mobiluse
Are those fixes for the current version? If so do you mind adding a new PR for those and I can get them merged in.
Thanks!
@dlutton I'm @mobiluse xD I've created the PR.
It's been a while since I made this, LMK if there's any support that I can give. Kudos for the work! 👌🏼