Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android get device overall audio output in pcm

Is there any way to intercept or just-read the audio output in android device?

I need to read the whole audio output in PCM from inside myActivity, including media player application in background, voice from calls, MediaPlayer istances inside myACtivity, etc., everything that's going to played by speakers. Actually, if it was possible to read them separately, would be great as well.

I tried with AudioRecord, giving it as audioSource parameter every constant found in MediaRecorder.AudioSource with no luck, should I try different audioSources?

Is it a so low-level task that has to be handled within native layer?

like image 712
lelloman Avatar asked Feb 28 '13 00:02

lelloman


1 Answers

The visualizer class is helpful. I use it to playback immediately played audio here.

This audio comes in very low quality, however, so it's only really good for visualization.

like image 179
TheLivingForce Avatar answered Oct 15 '22 16:10

TheLivingForce