How to record call in android? Is it possible? - android

I want to record call from android phone.
I am using android.media.MediaRecorder pckg.
Also used following code:
mrec.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
But I didn't succeed in recording an incoming call.
Can anyone recommend a tested code snippet?
Also,
Is this true?
http://groups.google.com/group/android-developers/browse_thread/thread/c2bc85eb60ae2aa5?pli=1
http://code.google.com/p/android/issues/detail?id=2117#c226

Standard distributions of Android does not support it till now.
You can vote up these if you want:
http://code.google.com/p/android/issues/detail?id=4075
http://code.google.com/p/android/issues/detail?id=2117

It's not a software problem and I don't think the baseband firmware vendors will fix this. Most likely because it's illegal in most western countries to record calls without consent of the other person.

Related

Bluetooth HFP support for Android App with SIP/VoIP

I am trying to add support for bluetooth devices like headsets/headphones/car stereo to my android app which allows user to make SIP/VoIP calls. I am trying to mostly address the requirements of Answering and Ending of calls using button on bluetooth headsets, other buttons/features handling is good to have.
With the search I have done and all the text I have read so far, I have come across the following-
One common way suggested everywhere is registering to ACTION_AUDIO_STATE_CHANGED. But this doesn't really helps me. Intents for it are sent every time the button on Bluetooth headset is pressed And also when we start the ring tone on bluetooth headset.
A very common solution I found was use of Bluetooth Adapter class. There isn't much you could do with it. So again not helpful.
Another approach I came across is the use of Vendor specific headset events. After some efforts I was able to get this working for specific Plantronics Bluetooth headsets. Supporting Jabra is important.
One more approach I came across is binding with IBluetoothHeadsetPhone.aidl, the way the phone app does it. I could find very little information on it, not enough to go ahead and implement any thing.
If anyone has done such things, I think the problem I am facing is not an uncommon one, I just believe it is not documented well.
Any pointer, approach, link would be appreciated.
I will try to add more info as I find any or any other approaches I try. Please ask for details if you need any more on the solutions I have tried. And please suggest changes instead of just flagging the question.
Thanks in adv.
Sorry about the late post. I was able to find a solution for this issue. It is not simple fix.
You need to use ConnectionService from Android telecom framework. Check out this link here & here. After this your VoIP calls will have cellular call like treatment.

There is any Android API to record call conversation and/or automatically answer calls?

Scanned through the Android API (reference) documentation, but didn't find specific API that allows one to achieve the following:
Be notified of an incoming call
Automatically answer or reject the incoming call
While a call is in progress, be able to capture the audio
Play a pre-recorded message, after answering the call
The intention behind the questions, as most might have guessed, is to have an automated answering machine type of application. I have seen such applications on Nokia Symbian OS devices.
If such functionality requires rooting the device, I'd still be interested in knowing the API's available once rooted!
As an aside, is there are separate API reference documentation for API's available to rooted devices ?
For the latter parts of your question, No.
Imagine for a second there was, and you had an app installed that uses it. It could record your conversations and send them to a 3rd party. The app might not even disclose that it does this.
That sounds like it would be a huge security problem... Don't you agree?
It would appear I am mistaken about the call recording part - several apps available on google play (such as this, this, and this) does call recording, at least of the user making the call.
For #1, this is covered by marcin_j's answer
For #2, these SO answers show you can accept or reject a call programmatically.
For #3, I did a bit more detailed search on this, which reveals a related Stackoverflow question and answer, which provides info on recording audio (as per the above linked apps). Please keep in mind there are likely legal requirements around recording calls.
For #4 (playing a message to the caller), the only info I was able to find on this says it is not supported. It's hard to find much more info on this with so much clutter on search coming up with apps that are basically an audio version of caller id.
Most of these answers are on StackOverflow already; hopefully bringing it all together here helps you.
You can use android.intent.action.PHONE_STATE broadcast, and check TelephonyManager.CALL_STATE_RINGING state. Requires android.permission.READ_PHONE_STATE.
2/3. Dont think you can do this, at least not on non-rooted phones. Maybe someone else will give better answer.

Intercept the outgoing call data, alter it & then write it back out- Why it is not possible?- Android

We are working on an application similar to "Funny Call" on Google Play.
When user makes a call to another another contact, we would be intercepting the call and will add some effects to it and then this modified sound will reach the recipient.
I've searched for the solution to this problem and found out that many developers say Android does not support this.
Android API for call sound stream manipulation
Can the Android API be leveraged to modify the caller's voice during the call?
But, I would still like to know if its really not possible straight from the horse's mouth. I would like to know if there is any specific reason behind this.
Is there really no way to achieve this?
Can you please also tell me if there is any possibility of this being possible in near future?
Is there really no way to achieve this?
If you read through the comments on the app you cited, it would appear that they are doing VOIP, and that their servers are then actually placing the call, as that is why there are calling rates to different countries. I see no evidence that they are using the on-device telephony capability. You, of course, are welcome to supply such evidence, if you have any.

Android Continuous Speech recognition? [duplicate]

I googled around and found the regular speech-api from google. But I think this isn't what I need. I need continious voice recognition and the ability to launch other actions when a specific word is spoken. Is there anything in the android sdk that I can use?
If not: Is it possible to implement third-party libraries? (If yes: which - and what do I have to think about when implement a third-party-library?)
Edit: I thought about this again. I have to recognize just one 'word' (that probably won't be in googles-speech-databases). I have the chance to record it. That means, I'm able to continiously match the incoming audio-stream against my recording. That should work without a database. But I'm new to android-development. Do you have suggestions for APIs to use for recording and matching the recorded? Or is there any better way to continiously wait for a specifig 'word' to occur and then process any further actions?
btw: if that wasn't clear described: the app should continue to record and watch for the word to occure again when the reaction is done.
Is there anything in the android sdk that I can use?
No, sorry.

Continuous Speechrecognition in Android

I googled around and found the regular speech-api from google. But I think this isn't what I need. I need continious voice recognition and the ability to launch other actions when a specific word is spoken. Is there anything in the android sdk that I can use?
If not: Is it possible to implement third-party libraries? (If yes: which - and what do I have to think about when implement a third-party-library?)
Edit: I thought about this again. I have to recognize just one 'word' (that probably won't be in googles-speech-databases). I have the chance to record it. That means, I'm able to continiously match the incoming audio-stream against my recording. That should work without a database. But I'm new to android-development. Do you have suggestions for APIs to use for recording and matching the recorded? Or is there any better way to continiously wait for a specifig 'word' to occur and then process any further actions?
btw: if that wasn't clear described: the app should continue to record and watch for the word to occure again when the reaction is done.
Is there anything in the android sdk that I can use?
No, sorry.

Categories

Resources