0

我知道无法将来自预先存在的 Android 应用程序(例如 Spotify)的音频输出重定向到 USB 声卡或文件。我相信这可能与隐私和电话录音有关。

我不太了解 Linux,但知道它非常灵活,并且经常阅读有关将一个程序的输出管道传输到另一个程序的输入的信息。我还看到,在一些 Android 的 dev 目录中,有一些名为“audio”的“文件”。

我的问题是 - 这些是否与原始音频输出相对应,如果平板电脑/手机已植根,是否可以用一些 Linux 魔法拦截流?

我的动机是提供比基本扬声器/耳机/蓝牙选项更高质量的音频输出。

4

1 回答 1

1

Short answer is yes, you might be able to hack something together. But the audio implementation on a particular handset is completely up to the manufacturer so there is no guarantee. It is unlikely to be as simple as you think. There is no one-line command line magic for it.

Android doesn't use the usual Linux ALSA user space code so you can not generalize from Linux and say "if I can do it in Linux I can do it on rooted Android".

I think that some Android implementations use TinyALSA but this is not a requirement. If this is the case you might be able to recompile TinyALSA with your own intercept logic or interpose your device some other way. Similarly if you are running an Android mod built from source you could modify it to intercept the audio at other levels such as in the Audio Flinger or at the interface to the HAL. This is less practical if you are just using a rooted device since manufacturers often modify system elements with customization that might make it difficult for you to interpose and intercept (just because you don't know what to substitute if the API has been modified).

Much of the info in this answer I gleaned from reading the Andraudio mailing list. You can check the archives to learn more.

于 2013-08-14T16:52:14.287 回答