How can I save my android tts output in a wav file?

后端 未结 3 1681
野趣味
野趣味 2021-01-02 14:19

I have looked almost everywhere trying to find a way to save my android tts output in an audio file. I looked at these posts:

  • How can I save TTS output in an a
3条回答
  •  礼貌的吻别
    2021-01-02 15:14

    TextToSpeech.synthesizeToFile() doesn't work in real devices. It only works in AVDs.

    I have been experimenting with this, too, using both the original Pico TTS engine and a third party TTS engine, trying to write to either the sdcard or the internal memory (on a rooted device):

    context.getDir("soundfiles", Context.MODE_WORLD_WRITEABLE);
    

    But, as you noted, the method returns TextToSpeech.SUCCESS without actually creating the file.

    If you must record your TTS output to a WAV file, connect the headset output to the aux input in a sound card in your PC and use any recording software to capture that.

提交回复
热议问题