android get device overall audio output in pcm

北战南征 提交于 2019-11-26 16:30:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/15125139/android-get-device-overall-audio-output-in-pcm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!