Install new language package automatically when app starts
Hi,
I created an identical issue in here w/ react-native-voice, but I am also creating a new one here because I think it is closely related to react-native-tts being that it is the Speech Synthesizer.
I am currently trying to automatically install a given voice package, not provided by default, throughout different devices (iOS and Android).
For example: (on Android) Each device model, namely: Samsung S9, Samsung S7, LG, and etc. have different default language packages
And currently I filter the output of Tts.voices() for English language packages and pick the first one.
...
const voices = await Tts.voices();
let voiceOption = voices.filter(voice => voice.id.match(/(en-US)/))[0];
await Tts.setDefaultVoice(voiceOption.id);
...
Since Tts.voices() output is different for each device model, that gives me different voice outputs. Thus, the user experience becomes different when the TTS voice is synthesized as expected.
I did install voice packages manually, and that does give me more options, but my goal here is to have my app to install a given voice package from Google TTS automatically (without the need for users to manually install it). Is that possible?
(on iOS) For English, by default, I get the following list:
...
[AVSpeechSynthesisVoice 0x608000009310] Language: en-AU, Name: Karen, Quality: Default [com.apple.ttsbundle.Karen-compact]
[AVSpeechSynthesisVoice 0x6080000098d0] Language: en-GB, Name: Daniel, Quality: Default [com.apple.ttsbundle.Daniel-compact]
[AVSpeechSynthesisVoice 0x6080000094e0] Language: en-IE, Name: Moira, Quality: Default [com.apple.ttsbundle.Moira-compact]
[AVSpeechSynthesisVoice 0x6080000096b0] Language: en-US, Name: Samantha, Quality: Default [com.apple.ttsbundle.Samantha-compact]
[AVSpeechSynthesisVoice 0x608000009480] Language: en-ZA, Name: Tessa, Quality: Default [com.apple.ttsbundle.Tessa-compact]
...
and because this list is equal throughout iOS devices, I can just set Samantha as the default voice without the need of filtering and selecting one language. And I can install new voice languages by going to:
Settings -> General -> Accessibility -> Speech -> Voices
My question here for iOS stays the same as for Android. Is it possible for me to have devices to install a specific voice language package as, for example, when the app starts? This would imply that the user would not need to install it manually.
Hopefully I could make my point clear enough. But please feel free to ask for clarification. I'll make sure to be more descriptive and explanatory if needed next.
Cheers.
your question is interesting. Did you find any solution? Could you see siri in voice languages? I can't #102
@nomercy89 I'm still trying to find a solution.
I also tried using Google Cloud Text-To-Speech, but the API does not seem to work with react-native. It's a bummer.
Regarding the Siri voice that you're looking for, I wasn't able to see it in the voice languages.
For Italian language (it-IT), I could only see Alice
Did you find a solution for this? I'm having the same issue but missing the correct language on app start on android. The result is that the user needs to go to the play store and download the language themselves, which is a major pain in the neck I'd love to be able to avoid.