Android voice activity detection offline - android

I need to detect if there is voice in the environment, and I need to do all the processing in the phone without sending any sound information to a server because of privacy concerns.
I know there is a class in android called SpeechRecognizer http://developer.android.com/reference/android/speech/SpeechRecognizer.html
But as far as I know, it needs to be connected to a google server (or other server).
My question is if there is a way of using this class to detect voice without sending info through internet.
I read a tip from here http://www.itworld.com/mobile-wireless/327712/use-offline-speech-text-your-android-jelly-bean-device which says that I could "Download offline speech recognition", but I don't know if this is enough for my needs.
I have some knowledge of signal processing and classification and I think I could develop a voice activity detection by using the Android AudioRecord class, but I would like to know first if SpeechRecognizer permits the detection offline (And how it does) so I could save time.
Thanks in advance for your response.

SpeechRecognizer is a way of connecting apps to speech recognizers. These speech recognizers extend RecognitionService. Some of these speech recognizers might do offline recognition, some of them might claim that they do, but actually don't. So if you have privacy concerns then rather implement your own recognizer.
The other question is if speech recognition is the right tool for voice activity detection.
Regarding the API to the speech recognizer, i.e. the constants in RecognizerIntent, there is no boolean for online/offline or anything specific for voice activity.

Related

Speech Recognition with MediaRecorder - Android

I am making an app in which I am recording a video and at the same time want to implement a speech-to-text recognition functionality without speech dialog, can someone tell me how to proceed.
I would recommend using the RecognizerIntent Class. The class sends the recorded speech to a Google cloud server. The server in turn converts the speech to text and sends the results to your app.
A worked out example can be found on the following site
right here.
Using this approach however does imply that your app will rely having a working internet connection. Only if the user decides to enable offline voice typing in the phone's settings, won't the app be relying on a working internet connection.

SpeechRecognizer with Audio recording in Android

I want to make a speech recognizer app which transcribes the user's speech. I do not want any dialog while doing that, so startActivityForResult with recognizerIntent is out of the option. (I know I can get audio if I use this approach)
I am using SpeechRecognizer for that and call startListening to listen user's audio. I am getting results with very good accuracy in onResults.
Now, I also need the audio of user stored in sdcard in my device. For that I have tried both MediaRecorder as well as AudioRecord, but not getting any success. I am always getting Network Error in onError of RecognitionListener. I can't find anyway on how to overcome this issue. I have also tried to get data from onBufferReceived, but in vain.
If anyone can throw some light on this, then that would be great.
[Edit]
Guys, this is not a duplicate of record/save audio from voice recognition intent, it's slightly different. The answer you gave is for Google Keep. Keep uses the dialog to get data. I do not need a dialog hanging on the screen.
I have successfully accomplished this with the help of CLOUD SPEECH API.
You can find it's demo by google speech.
The API recognizes over 80 languages and variants, to support your
global user base. You can transcribe the text of users dictating to an
application’s microphone, enable command-and-control through voice, or
transcribe audio files, among many other use cases. Recognize audio
uploaded in the request, and integrate with your audio storage on
Google Cloud Storage, by using the same technology Google uses to
power its own products.
It uses audio buffer to transcribe data with help of Google Speech API. I have used this buffer to store Audio recording with help of AudioRecorder.
So with this demo we can transcribe user's speech parallely with Audio Recording.

Offline Speech Recognition on Android Wear

I am using the RecognizerIntent inside an Android Wear application I am developing to obtain Free-form Speech Input.
It is working great when my phone is connected online. However, when I turn off my Internet connection on the phone, the Watch is able to recognize the speech and the correct text is displayed in the intent while processing, but afterwards it states "Didn't Catch that".
I've also tried implementing the RecognitionListener interface and I had the same issue.
Some of the tutorials I have tried using include:
RecognitionListener interface
Voice Tutorial
I have the appropriate language packs downloaded on my phone. How can I solve this and fix the offline issue on my wearable device?
Thank you.
Speech recognition requires access to Google's servers hence it won't work without a valid internet connection. It is possible in Android to download languages to work offline (Settings). Although, I'm not sure if this works with Wear.

Offline Speech to text in Android?

I would like to do an application in android which translates speech from incoming call to text. Since i cant connect to mobile data while on call, i have to do the conversion offline.. Is it possible? Can I use any API or libraries to do it? Also is there any restrictions in tapping incoming voice? Please do reply..
Regular apps can record the phone owner side of the conversation, but to also record the remote user's voice, you need to have root access as well as a kernel patch.
As far as voice transcription, I don't know of any api you could use for free straight from the phone (assuming you get the recorded audio).

sharing audio input on Android

I am doing some preparation research for an Android phone app that would involve voice search or speech recognition while the user is simultaneously engaged in a phone call. I'm finding that when I am in the middle of a call and attempt to invoke voice search or a similar action that would take input from the microphone I get an "audio error" message. Does the phone app take exclusive control over the microphone input of the phone such that other apps cannot get access to audio input?
In answer to the direct question, Yes. The phone app takes full exclusive control over the microphone input. This is the same with all apps that use the microphone. Only one app can have access to the microphone at a time. HOWEVER, in hope for your app, you can access the voice uplink stream, which is the same thing (it is what is spoken into the mic and uploaded to the service towers), plus it won't interfere with the call at all. You can do it like this:
MediaRecorder mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_UPLINK);
You will have to add the permissions to record to the Manifest and such, but that's about it for that. Luckily the speech recognition stuff is all built in, so you should be able to find out how to do that fairly easily by just poking around a bit on here or Googleing it. Unfortunately, I myself don't have anything to offer you in that field however.
Hope this helps!

Categories

Resources