Get Android audio stream

寵の児 提交于 2019-12-20 02:34:09

问题


I want to create Android application, which will record all audio from the device speakers. For example somebody is watching youtube video on the phone and he will be able to save sound from it, using my application.

Is it possible without framework modification ?


回答1:


There's the Visualizer class that let's you grab a low-quality version of the currently playing audio. It probably wouldn't be good enough for the use-case you describe though.

Other than that there's no officially supported way of recording audio output in Android. You could of course turn up the speaker volume and try to record the speaker output with the phone's microphone, but that will most likely sound as bad or worse as the audio you can get through the Visualizer.

There are platforms that provide support at the hardware and driver level for accessing audio output (after mixing and volume/effect application) as a recording device by looping the audio back into an ALSA PCM capture device. But I'm not aware of any Android phones that implement this in a way that can be used by app developers.



来源:https://stackoverflow.com/questions/15003241/get-android-audio-stream

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