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

Can we have voice selection, at least for android? #16

Closed
1 task
honzasvasek opened this issue Dec 27, 2018 · 5 comments
Closed
1 task

Can we have voice selection, at least for android? #16

honzasvasek opened this issue Dec 27, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@honzasvasek
Copy link

🚀 Feature Requests

Android Voice Selection.

tts.setvoice() implementation (so we can select male or female voices) can be done by setting de voice number in default voice in setup, but it would be nice to be able to do this from the app.

Platforms affected (mark all that apply)

  • 📱 iOS
  • [X ] 🤖 Android
@dlutton
Copy link
Owner

dlutton commented Dec 27, 2018

@honzasvasek I can definitely add tts.setVoice() however you'll have to pass an object back similar to the voice object required to set the voice setVoice

Voice (String name,  Locale locale, int quality, int latency, boolean requiresNetworkConnection, Set<String> features) 

Unfortunately there isn't an option for passing a value for "male" or "female". Android TTS Reference - this provides all of the methods the Android TTS package provides.

Here is an example of what getVoices() returns and as you can see, some may result with a name of #male in it however not all of them do.

[Voice[Name: es-us-x-sfb-local, locale: es_US, quality: 400, latency: 200, requiresNetwork: false, features: [networkTimeoutMs, notInstalled, networkRetriesCount]], Voice[Name: fr-fr-x-vlf#male_1-local, locale: fr_FR, quality: 400, latency: 200, requiresNetwork: false, features: [networkTimeoutMs, notInstalled, networkRetriesCount]]

@honzasvasek
Copy link
Author

@dlutton would be great if you add this, but how about using the same approach as in the Google TTS setup voice selection UI, just giving the voice number (that being the index into the voice list). So we can use flutterTts.setVoice(4); to select Voice #4.

@dlutton
Copy link
Owner

dlutton commented Jan 6, 2019

@honzasvasek so you'd like a getVoices option to return a list of voices and then a setVoice to set the voice based on that index of getVoices?

@dlutton dlutton self-assigned this Jan 6, 2019
@dlutton dlutton added the enhancement New feature or request label Jan 6, 2019
@honzasvasek
Copy link
Author

honzasvasek commented Jan 6, 2019 via email

@dlutton
Copy link
Owner

dlutton commented Jan 9, 2019

@honzasvasek unfortunately there isn't an easy way to do a setVoice(1) as you previously mentioned. getvoices() can return over 200 voices with some of them having male and/or female voices. I did however add a getVoices and setVoice function for you in the latest version which you can play around with. I'm hoping that's enough for you to add some logic to your application for what you need. If you have other ideas for this implementation, please let me know or submit a PR.

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

No branches or pull requests

2 participants