I am looking to create an app which has Speech to text.
I am aware of this kind of ability using the RecognizerIntent: http://android-developers.blogspot.com/search/label/Speech%20Input
However – I do not want a new Intent to be popped up, I want to do the analysis a certain points in my current app, and I dont want it to pop something up stating that it is currently attempting to record your voice.
Has anybody any ideas on how best to do this. I was perhaps thinking of trying Sphinx 4 – but I dont know if this would be able to run on Android – has anyone got any advice or experience?!
I was wondering if I could alter the code here to perhaps not bothering to show the UI or button and just do the processing: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html
Cheers,
If you don’t want to use the
RecognizerIntentto do speech recognition, you could still use theSpeechRecognizerclass to do it. However, using that class is a little bit more tricky than using the intent. As a final note, I would highly suggest to let the user know when he is recorded, otherwise he might be very set up, when he finally finds out.Edit: A small example inspired (but changed) from,
SpeechRecognizer causes ANR… I need help with Android speech API
Important: Run this code from the UI Thread, and make sure you have required permissions.