简体   繁体   English

录制 Android 音频输出

[英]Record Android Audio Output

Many people are asking for this, no one seems to have an answer so I do neither.很多人都在问这个,似乎没有人有答案,所以我也不做。

How is it possible that some apps serve the function to record the audio output of the android system?某些应用程序如何提供记录android系统音频输出的功能? Everything I am finding is the very same tutorial on 1432 different sites where you can record MIC input.我发现的一切都是在 1432 个不同站点上的完全相同的教程,您可以在其中记录 MIC 输入。 I don't care about mic input, I want the audio output and just can't imagine how to access it.我不在乎麦克风输入,我想要音频输出,只是无法想象如何访问它。

If everyone can get me on the right way, I would be so happy.如果每个人都能让我走上正确的道路,我会很高兴。

Seems to be currently there is no way to achieve this.似乎目前没有办法实现这一点。

This is another question related to this : android get device overall audio output in pcm这是另一个与此相关的问题: android get device整体音频输出为 pcm

The closest API available to you for these purposes is Visualizer .可用于这些目的的最接近的 API 是Visualizer Which only captures "partial and low quality audio content".仅捕获“部分和低质量的音频内容”。

I imagine direct audio capture functionality is omitted to prevent pro-piracy apps.我想直接音频捕获功能被省略以防止盗版应用程序。 It may be worth noting that there is a CAPTURE_AUDIO_OUTPUT permission, but it is "Not for use by third-party applications".可能值得注意的是,有一个CAPTURE_AUDIO_OUTPUT权限,但它是“不供第三方应用程序使用”。 So if you really do have legitimate apps that are capable of this, as you claim, they are likely system apps.因此,如果您确实拥有能够做到这一点的合法应用程序,正如您所声称的那样,它们很可能是系统应用程序。 Even if you wrote an app that generated its own musical sequences, for example, you would still have to write your own encoder/decoder to achieve anything close to what you're asking for (and that wouldn't even be considered audio capture at that point.)例如,即使您编写了一个生成自己音乐序列的应用程序,您仍然必须编写自己的编码器/解码器来实现任何接近您所要求的东西(这甚至不会被视为音频捕获)那一点。)

To put it bluntly, it's currently impossible without breaking any ToS with Google or your phone provider, and will probably remain so indefinitely.坦率地说,在不违反Google或您的电话提供商的任何 ToS 的情况下,目前是不可能的,并且可能会无限期地保持下去。

只需使用双向 AUX 电缆并将其挂在您的手机耳机端口,然后将其另一端挂接到您的音频接口“线路输入”通道(或您音频接口上的任何输入),然后通过大胆或任何好的音频记录该输入录音机。

TL;DR : use the SCR Screen Recorder app to capture video + internal audio (not microphone) [require root] TL;DR :使用SCR Screen Recorder应用程序捕获视频 + 内部音频(不是麦克风)[需要 root]

Long answer长答案

Original answer: Record tablet's screen AND audio原始答案: 录制平板电脑的屏幕和音频

Jeff's answer seems to be the only way you can use through adb.杰夫的答案似乎是您可以通过 adb 使用的唯一方法。 But that force you to do some work (merge video + audio).但这迫使您做一些工作(合并视频 + 音频)。

I could do it this way :我可以这样做:

 - connect the Android device to computer with a jack cable (headphone output to microphone input); - record video with adb shell; - record audio with Audacity (or anything else) - then merge video and audio with a video editor (pitivi, openshot, avconv...)

Another way is to directly use an android app:另一种方法是直接使用 android 应用程序:

SCR Screen Recorder : SCR屏幕录像机

Mobizen for SAMSUNG :三星的 Mobizen :

  • pros优点
    • on google play store在 Google Play 商店
  • cons缺点
    • only the samsung version works for recording internal audio, the general or LG, XIAOMI version can't record internal audio只有三星版本可以录制内部音频,一般或LG,小米版本不能录制内部音频
    • still a beta feature仍然是测试版功能
    • require root for recording internal audio需要 root 来录制内部音频

RecMe :推荐

  • pros优点
    • on google play store在 Google Play 商店
  • cons缺点
    • internal audio recording doesn't works on most devices内部录音不适用于大多数设备
    • require root for recording internal audio需要 root 来录制内部音频

Personally I tried a lot of apps and the only working for me is SCR Screen Recorder.我个人尝试了很多应用程序,唯一对我有用的是 SCR Screen Recorder。

PS : all these apps works without root if not using internal audio. PS:如果不使用内部音频,所有这些应用程序都可以在没有 root 的情况下运行。

In Android 10, they have introduced Audio Playback Capture API using which we can capture the Audio being played by other applications.在 Android 10 中,他们引入了音频播放捕获 API ,我们可以使用它来捕获其他应用程序正在播放的音频。 But it's not available in previous android versions.但它在以前的 android 版本中不可用。

An app X can also prevent any other app from listening, if that app hasn't added any constraint then this API can be used.应用程序 X 还可以阻止任何其他应用程序进行侦听,如果该应用程序未添加任何约束,则可以使用此 API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM