Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Record audio that is being played from device to headphone jack

I'm looking for a way to combine audio recorded from the device microphone with the sound that the device is playing.

Now you might say that it's an easy task, the microphone can record both BUT that's not the case because the audio that the device is playing is played to the headphone jack instead of the speakers.

Is there any way to do this?

like image 740
ori888 Avatar asked Apr 07 '16 09:04

ori888


People also ask

How do I record audio through my headphone jack?

One audio jack at the end of the audio cable must be inserted to headphone, while the other end must be inserted to the microphone slot on your computer. Once this operation is done, that means the output audio will be redirected as the input audio. Then any audio can be recorded as you need from the microphone.

How do I record audio output from device?

Go to Audio source and select Internal audio. You can use a third-party screen recorder app from the Google Play Store if your phone doesn't have one built-in. Using the AZ Screen Recorder as an example, go to the app settings, enable Record audio, tap on Audio source, and select Internal audio.

Can a phone record through my headphone jack?

NO! the Headphone socket is for OUTPUT, you need INPUT to make a recording. Most phones use the same socket for microphone, but it is connected to a TRRS plug. If you connect the plug correctly, then you can certainly make a recording, just as if you used a microphone.


1 Answers

I don't understand what you want. if you are talking about recording input source there are various source android OS provide to you such as MIC, DOWNLINK/Headphone speaker CAMCORDER etc...

Source Sode From android developer site

private void startRecording() {
        mRecorder = new MediaRecorder();
        mRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_DOWNLINK);
        mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        mRecorder.setOutputFile(mFileName);
        mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

        try {
            mRecorder.prepare();
        } catch (IOException e) {
            Log.e(LOG_TAG, "prepare() failed");
        }

        mRecorder.start();
    }
like image 165
Attaullah Avatar answered Oct 07 '22 19:10

Attaullah