There is a class that allows you to record sound (at the moment from the microphone of the phone) and then save the file to the memory card.
Instead of a sound source (MIC - microphone), you need to record the sound that plays through the speaker, or in other words: (the application plays audio, I wanted to record this audio.)
That is, the source should be the audio that plays on the phone, and not through the microphone. Is it possible?
The code snippet where the microphone is fed to the input:
public void recordAudio(View v) { AndroidAudioRecorder.with(this) // Required .setFilePath(AUDIO_FILE_PATH) .setColor(ContextCompat.getColor(this, R.color.recorder_bg)) .setRequestCode(REQUEST_RECORD_AUDIO) // Optional .setSource(AudioSource.MIC) //袟袛袝小鞋 袙袨袟袦袨袞袧袨 袛袪校袚袨袡 袠小孝袨效袧袠袣 袟袙校袣袗 袩袨袛袗孝鞋? 袗 袠袦袝袧袧袨 袗校袛袠袨, 袣袨孝袨袪袨袝 袠袚袪袗袝孝 袧袗 校小孝袪袨袡小孝袙袝. .setChannel(STEREO) .setSampleRate(HZ_48000) .setAutoStart(false) .setKeepDisplayOn(true) // Start recording .record(); }