1

My Android application relies on a closed-source Text-To-Speech API. When I invoke .speak(String s) method it coverts supplied text to sound and plays it back. However, I also want to be able to save that sound to an .mp3 file for later playback.

So, is it somehow possible to redirect an AudioStream to a file?

ivt
  • 301
  • 3
  • 9
  • You don't redirect it, you SAVE it.. – Bojan Kogoj Sep 18 '11 at 10:40
  • Could you please tell me how to do that, at least remotely? – ivt Sep 18 '11 at 10:42
  • I don't really know. Example is [here](http://stackoverflow.com/questions/963503/how-to-save-text-to-speech-as-a-wav-with-microsoft-sapi), but that's using a different API. I think API details might help to solve your issue – Bojan Kogoj Sep 18 '11 at 10:59
  • Thank you! Yeah, that's .NET, unfortunately Android doesn't have anything similar. It does have an AudioRecorder class, but there is no SPEAKER for audio source, only MIC, VOICE, etc – ivt Sep 18 '11 at 11:06
  • 1
    Well you have a lot of stuff [here](http://developer.android.com/resources/articles/tts.html) about it, take a good look at "File rendering and playback" – Bojan Kogoj Sep 18 '11 at 11:10
  • Thanks! Yes, I know that the standard Android Text-To-Speech API has .synthesizeToFile() method, and it's great. But I cannot use that API because it doesn't support all the languages I need. So, I have to use other proprietary API which doesn't have that feature, alas. And because it's closed-source, I can't do anything about it. – ivt Sep 18 '11 at 11:30

0 Answers0