Alternative 1
The TextToSpeech library does not support audio recording , however, you may try to get into write mode while you speak through the MediaRecord class. > :
MediaRecorder minhaRecorder = new MediaRecorder();
To start a recording, you need to use the methods prepare()
and start()
:
minhaRecorder.prepare();
minhaRecorder.start();
A TextToSpeech can only be used to synthesize text.
It is important to note that not all languages are supported by the API TextToSpeech . So it's interesting to run isLanguageAvailable
to see whether or not you can use a particular language in this framework.
Alternative 2
This would be another alternative if you did not want to use the user's voice. You can use Google Translate to read text that has been capitalized by voice and convert to MP3. Then your job would be to save this MP3 inside your application, however it would only work if you have Internet, because it would access Google Translator in real time. See the link below using the word "test" .
link
Details