I was making an app in flutter which used the flutter_tts package. The flutter text to speech worked perfectly on the emulator, but when I built the app on a real device, it does not function.
speak(String text) async {
await flutterTts.setLanguage('ro');
await flutterTts.setPitch(1.0);
await flutterTts.speak(text);
}
This is the code snippet that enables the talk function.
Can someone help me identify the issue please?
P.S. I am kind of a noob to stackoverflow so I don’t really know if I should add any extra stuff, so tell me if you need anything.
I tried searching up the problem on the internet with 0 succes, and some help on at least what coul be the problem would be apreciated.
2
Answers
So basically I found the issue,
You have to set the system language to whatever language you have on your text to speech. Got really scared there :).
Before setting the language check if the language is available on the device using the
isLanguageAvailable()
methodIf you go to your "Settings" and then search for "Text-to-speech output" you can see your available languages.