Can the audio stream output from the earpiece during a call be captured?

I am looking to develop an application and would like to know if the earpiece audio output can be captured.

Thanks, Matt

Asked by: Catherine966 | Posted: 20-01-2022

Answer 1

Looking at the documentation for MediaRecorder.AudioSource I would say that this should be possible using the VOICE_DOWNLINK source.

MediaRecorder recorder = new MediaRecorder();

Answered by: Stuart248 | Posted: 21-02-2022

Similar questions

android - play audio through earpiece

I have the OnQBVideoChatListener from QuickBlox SDK for Android set as follow: OnQBVideoChatListener qbVideoChatListener = new OnQBVideoChatListener() { ... @Override public void onOpponentAudioDataReceive(byte[] audioData) { QBVideoChatController.getInstance().playAudio(audioData); } ... } The playAudio method is currently playing what the opponent says throug...

android - Detect when sound is playing through earpiece speaker

Background I'm developing an app that monitors the proximity sensor. However, I don't want to monitor the sensor while the user is listening to something through the phone ear speaker. This is because the user will probably have his/her head against the handset to listen, which in turn triggers the proximity sensor, and I'm not trying to detect head proximity. Question How can I detect whe...

Route calls audio to earpiece Android M

I would like to hear audio calls from earpiece and speak with default smartphone's microphone when earphones are plugged in. I read lot of questions on stackoverflow but nothing of them works with Android M (developer preview). Thare are a lot of methods deprecated that seem not work. Has anyone got a solution for that? Thank you in advance.

Android Audio Through Earpiece

I am trying to play the audio through the earpiece. I used following code: audioManager.setMode(AudioManager.USE_DEFAULT_STREAM_TYPE); audioManager.setSpeakerphoneOn(false); Also declared permission in Manifest. <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> The problem is that these lines modify the audio mod...

Android - some devices not playing audio through earpiece

There seems to be an issue while trying to play audio files on earpiece in some android devices. Expected behaviour is it should play the audio file in earpiece but in some devices like Samsung galaxy note 2 ( Android version 4.4.2) and Sony Xperia XA ( Android version 6.0) it plays them through speakers. However in devices like Motorola moto g (android version 6.0) and nexus 5X (android version 7.0) it works fine...

audio - Playing the same music file in the same time on speaker and earpiece, Android

Is it possible to do it on android? Ofc I'm talking about phones that use only one speaker for media playback. My phone is Nexus5X. I dont want to root it or mess with system files cause of warranty. So can an app without root be made to do smth like that? p.s. I tried SoundAbout didnt work.

android - Switch between Headset and Earpiece

Here what I want to do in the app: When I'm having a phone call on my android device, I want to use the audio jack to send the call's audio to a circuit to do some processing on it. At the same time, I want to have the caller's voice through device's earpiece so that I can talk to him. I can switch between a wired headphone and device's speaker using audioManager, but haven't had any luck in turning on the ...

Android WebView and audio output on earpiece

How can I force an Android WebView which loads a webrtc page to use the "earpiece" as default audio output instead of the loudspeaker? I tried this code, but the sound keeps coming out of the speakers, not the earpiece: AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); audioManager.setSpeakerp...

How to change the audio output from speaker phone to earpiece in flutter android?

I'm using flutter_webrtc package for audio call functionality of my app and by default the audio output is on speakerphone how can I change the speaker phone to earpiece in flutter. By analysing the code I used this method which is method in RTCVideoRenderer class called audioOutput but it throws unImplementedError.

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Android