Android: Accessing the microphone simultaneously (RecognizerIntent + own app) - android

my app uses the RecognizerIntent to record the user's voice and doing some speech recognition.
Now, I'd like to compare the results to some open source speech recognition engines. Most of them take an audio file as input. My thought was, to capture the sound from the Android's microphone, and start the RecognizerIntent at the same time. But it seems, that accessing the microphone is exclusive.
Is it possible to use the RecognizerIntent with a recorded audio stream?
Is it possible to access the microphone simultaneously with two Activites?

I have tried to find a solution to the same problem and have not had success. One other approach we explored was to access the web service that Google uses for recognition. I posted a question at Google's voice search speech recognition service, but it still goes unanswered.
There was a good post at Voice recognition on android with recorded sound clip? that dealt with this question and I believe the answer came from a Google employee.

Unfortunately the answer to both of your questions is no, but there are plans to extend this for Gingerbread and 3.0: http://www.mobiclue.com/android-3-0-gingerbread-features-supported-phones.html

I know for sure that is possible to use RecognizerIntent and save the audio, the question is how?
You can see in Google Keep Android applications doing it once you click in the microphone.

Related

Voice Recognition with an audio file?

I am currently working on an app that would require recording the audio within my app and then sending the clip to google for transcription.
Is there any way I can send an audio clip to be processed with speech to text?
Or is there any other way other than this to convert that recording to text ?
Google's Voice To Text API is not available publicly at the moment and there's no announcement on where it could become available. On Android you can use system voice recognition feature, but it will only transcribe what it records by itself and your won't be able to feed it with any audio file for processing.
As for now, you either need to use other services like AT&T's, IBM's Watson, Dragon Dictation (all are on-line) or maybe consider including Sphinx CMU into your app if you absolutely demand off-line solution.

Integrate Google Voice Recognition in Android app

I want to introduce a new feature into my app: permanent voice recognition.
First of all I followed these posts:
Voice recognition
Speech recognition in Android
Offline Speech Recognition In Android (JellyBean)
and more others, plus other posts from different websites.
Problem:
What actually I'm trying to do is to have a permanent voice recognition without displaying google's voice activity. For example: When I start the application the voice recognition should start and listen. When the recognizer matches some words then my app will do different actions accordingly. I do not like to press a button every time I want to do voice recognition, and also I do not like to appear anything on the screen to talk to. Can I do that?
Any suggestions are welcome. Thank you! :)
Android can use voice recognition without any GUI. You can use SpeechRecognizer class to do this. But google doesn't allow you to use theirs voice tools for long time recognition. After 5-7 seconds of silence it will be stopped.
If you want to use limited comands vocabulary, you can use offline continious recognition like PocketSphinx.
For long time recognition you can use:
intent.putExtra("android.speech.extra.DICTATION_MODE", true);

Voice speech recognition android remove google screen and microphone button

I'm using voice speech recognition from Android API.
I followed successfully this tutorial:
http://code4reference.com/2012/07/tutorial-android-voice-recognition/#comment-335
But I've an unsolved question.
How cain I remove the screen that appear when calling RecognizerIntent??
I'm talking about removing google and microphone button that advice that I'm using speech recognition.
I need to remove this small screen because I need to do other things on screen while that is recognizeing my voice.
You need to write a service class that call createSpeechRecognizer. You can get an idea of how to do it in my answer at Android Speech Recognition as a service on Android 4.1 & 4.2
You'd need to work at a lower level than this example. What this example does is launch an app that does voice recognition for you and sends you the results. That app is drawing the UI, and you can't stop it. What you'd need to do is write an app against the service that actually does the voice recognition (basicly, exactly what that intent is doing). You can probably find an example of this in the Android keyboard code, as they provide a custom UI against Google voice.
You cannot do this. The screen is not displayed by your app, but is displayed by the voice recognition API instead, and you cannot control it.
In any case, that screen is a standard for voice recognition on the device, and users are familiar with it. It would be something of an anti pattern to remove it and conduct voice recognition. With the screen there, users will know that voice recognition is active, and that the microphone is picking up sound as it provides that feedback.
Use SpeechRecognizer. The Intent mechanism is similar.
For convienience use the recognizeDirectly method in this helper class

Play pre-recorded audio into a voice call

The question have been asked before ( How to play an audio file on a voice call in android, play an audio file on a voice call etc), but I will ask it anyway: Is it possible to play an audio file into an ongoing voice call. I know the short answer is "No", but I have not figured out why it is not possible.
I know the SDK does not have support for it, but would it by any chance be possible in some way to write your own code that handles this, maybe with help from C/C++ code (using the NDK)? Does anyone have any idea on how to solve this? Or is the answer a strict "no, you cannot play pre-recorded audio into a voice call"?
I do not really care if the solution does not work on all devices, as long as I can find some devices that support the solution, and I can consider the get root access if that is needed.
I used Audiotrack to play audio with stream set to STREAM_VOICE_CALL during voice call on my One-Plus(Test Device) and it worked perfectly, however the audio which I speak is heard clearly and the music played is not heard. Probably because of the noise cancellation feature applied. I used Lollipop based Rom for this.So the answer is yes we can play.

Is it possible to record calls both sides(mic,speaker) in android?

i'm trying to develop an application to record calls bothside(mic and speaker). I've seen there is one app vrecorder providing this vrecorder for android 1.6.
Now i want to do this for android 2.2 and above. Can i know is this possible with MediaRecorder.AudioSource.
I've read some forums they are saying that there are some issues on doing this.
In Stackoverflow itself several questions are about record voice calls saying that not posible. But these posts are older. Is it possible to record phone calls via an Android App? .
But http://code.google.com/p/android/issues/detail?id=2117 in this discussion they are saying that some issues are there but we can implement.
Atlast, please I need some descriptive answers, that can we record voice calls in android both way (from mic and speaker).
Thanks in advance.
Call recording is not yet possible on Android. The feature request you are referencing is still not resolved.
People that have been able to do call recording use rooted phones with custom kernel.
On stock Android phones, you can only record your voice from microphone, but you can not record the sound of the other party. If you only want to record your voice use android.media.MediaRecorder.AudioSource.MIC

Categories

Resources