开发者

Play an audio file as soon as Text To Speech is completed in Android

开发者_Go百科

I'm trying to develop an Android app where as soon as the text to speech is completed an audio file has to be played. How to do this?


If I didn't get wrong idea, you want to use text-to-speech to read some text and store the speech audio into phone in the meantime? And play the audio later?

Have you checked AudioRecordTest? You can record audio and then play it later. Worth to try but I don't think you can get a good quality from the microphone. Hope this helps:)

By the way, as far as I know, android only support to record from mic for unrooted phone, which you can check here. Let me know if you can record sound source from the android system.


I have found the solution and that is in the method onUtteranceCompletedListener() we can know whether the speech is stopped or not and then we can write the code to play the audio file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜