flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

[iOS] Add additional `quality` field to return value of `getVoices` to distinguish different voices

Open SPICYJO opened this issue 2 years ago • 1 comments

🚀 Feature Requests

  • Add additional quality field to the map returned by getVoices for identification of voices.

Contextualize the feature

  • For now, we cannot distinguish two voices of the same name when we install the enhanced version of voice in iOS.

  • If we install the additional voices of the same name with different qualities (normal, enhanced, and premium), and call the getVoices function, we cannot distinguish the voices of the same name.

Reproduction steps

  • Settings > Accessibility > Spoken Content > Voices > Install additional voices with different qualities image

  • Then, calling the getVoices returns map containing indistinguishable entries of voices. image

Describe the feature

  • Adding an additional field describing quality would help. iOS's AVSpeechSynthesisVoice class has quality field, so I think we can use that. (iOS enum values: default, enhanced, premium)
  • Android's API also provide quality field too. (Android values: QUALITY_VERY_HIGH, QUALITY_HIGH, QUALITY_NORMAL, QUALITY_LOW, QUALITY_VERY_LOW)
  • Web API does not provide quality field.

Platforms affected (mark all that apply)

  • [x] :iphone: iOS
  • [x] :robot: Android (maybe)

SPICYJO avatar Jun 23 '23 11:06 SPICYJO

I'm able to discover premium/enhanced voices via getVoices and select them appropriately on an iPhone X running iOS 16.6.

For example, after installing Susan (enhanced), getVoices returns: Susan (Enhanced), locale: en-US

From there, you can do

flutterTTS.setVoice({"name": 'Susan (Enhanced)', "locale":'en-US'});

Colton127 avatar Jul 26 '23 21:07 Colton127