flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

Using Voice class instead of Map + Including gender when available

Open CodingAleCR opened this issue 4 years ago • 9 comments

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.

CodingAleCR avatar Aug 24 '21 15:08 CodingAleCR

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. 😉

CodingAleCR avatar Aug 24 '21 15:08 CodingAleCR

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 avatar Aug 24 '21 17:08 dlutton

@dlutton When will this PR be merged ?

theatifwaheed avatar Mar 24 '24 16:03 theatifwaheed

@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.

dlutton avatar Mar 24 '24 20:03 dlutton

Acknowledged @dlutton I also figured 2 issues. I fixed in the https://github.com/theatifwaheed/flutter_tts Fork of this Branch.

mobiluse avatar Mar 24 '24 20:03 mobiluse

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 avatar Mar 24 '24 20:03 mobiluse

@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 avatar Mar 24 '24 20:03 dlutton

@dlutton I'm @mobiluse xD I've created the PR.

theatifwaheed avatar Mar 24 '24 20:03 theatifwaheed

It's been a while since I made this, LMK if there's any support that I can give. Kudos for the work! 👌🏼

CodingAleCR avatar Mar 24 '24 20:03 CodingAleCR