Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AudioSource.VOICE_CALL not working in android 4.0 but working in android 2.3

VOICE_CALL, VOICE_DOWNLINK ,VOICE_UPLINK  

not working on android 4.0 but working on android 2.3 (Actual Device),I have uploaded a dummy project to record all outgoing call so that you can see it for your self

http://www.mediafire.com/?img6dg5y9ri5c7rrtcajwc5ycgpo2nf

you just have to change audioSource = MediaRecorder.AudioSource.MIC; to audioSource = MediaRecorder.AudioSource.VOICE_CALL; on line 118 in TService.java

If you come across any error, tell me. Any suggestion related to it will be accepted.

like image 644
Auto-Droid ツ Avatar asked Feb 06 '13 12:02

Auto-Droid ツ


3 Answers

OK, in my case this code (thank you eyal!) worked for Samsung Galaxy Note 6:

String manufacturer = Build.MANUFACTURER;
if (manufacturer.toLowerCase().contains("samsung")) {
    recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION);
} else {
    recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
}
like image 116
Jalal Avatar answered Nov 05 '22 21:11

Jalal


After a lot of search I Found that Some Manufactures have closed the access to such function because call recording is not allowed in some countries. If anyone finds such question and get the solution some other way then post it over here it may be helpful to many because many people are have the same issue.

like image 34
Auto-Droid ツ Avatar answered Nov 05 '22 20:11

Auto-Droid ツ


Try to use MediaRecorder.AudioSource.VOICE_RECOGNITION. I had the same problem - ASUS Transformer uses microphone near the back camera by default and audio is very silent in this case. VOICE_CALL doesn't work on this tablet and I have tried VOICE_RECOGNITION - in that case it uses front microphone and audio volume is OK.

like image 45
Roman Popov Avatar answered Nov 05 '22 19:11

Roman Popov