获取Android的音频流音频、Android

2023-09-07 15:21:44 作者:快手

我想创建Android应用程序,它会从设备的扬声器记录所有的音频。例如有人在看手机上的YouTube视频,他将能够保存声音的,用我的应用程序。

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 ?

推荐答案

还有的的,它可以让你抓住当前播放音频的低质量版本的展示台类。这可能不会对用例描述你虽然不够好。

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.

除此之外,有没有正式支持录制音频输出Android的方式。当然,你也可以调高扬声器音量,并试图记录与手机的麦克风扬声器输出,但将最有可能听起来糟,甚至更糟的音频,你可以通过可视化。

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.

有提供支持的硬件和驱动程序级别的访问通过循环音量恢复到ALSA的PCM捕获装置,记录装置(混合和体积/效果的应用程序之后)音频输出平台。但我不知道实现这个的,可用于应用程序开发方式:在任何Android手机。

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.