TextToSpeech.synthesizeToFile () does not work on real devices. It works only in AVD.
I also experimented with this, using both the original Pico TTS engine and the third-party TTS engine, trying to write to either an SD card or internal memory (on the root device):
context.getDir("soundfiles", Context.MODE_WORLD_WRITEABLE);
But, as you noted, the method returns TextToSpeech.SUCCESS without actually creating the file.
If you need to write your TTS output to a WAV file, connect the headset output to the aux input on the sound card on your PC and use any recording software to fix it.
ateiob
source share