录制/捕获Android应用程序的内部声音播放并导出mp3? [英] Record/capture internal sound playback of Android app and export mp3?

查看:48
本文介绍了录制/捕获Android应用程序的内部声音播放并导出mp3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以录制应用产生的内部声音?

Is it possible to record the internal sound generated by the app?

我的应用程序允许您创建和播放音乐序列.

My app allows you to create and play back musical sequences.

soundPool.play(soundIds[i], 1f, 1f, 1, 0,  Constants.TIME_RATE);

我希望能够录制序列并导出为 mp3.

I'd like to be able to record the sequence and export to mp3.

我研究了音频捕获 但 setAudioSource (int audio_source) 似乎只接受 MIC 录音.

I've looked into Audio Capture but setAudioSource (int audio_source) only seems to accept MIC recording.

谢谢

推荐答案

不,没有用于获取音频输出的 API,即使对于您自己的应用程序也是如此(实际上这并不完全正确,因为您可以通过 Visualizer API,但它会是这样的低质量,我怀疑它对你有任何用处).

No, there's no API for getting the audio output, even for your own app (actually that's not entirely true, because you can get it through the Visualizer API, but it would be of such low quality that I doubt it would be of any use for you).

如果您想要这种功能,则必须自己实现.那是;当您开始播放声音时,将它们混合并将结果写入文件.如果声音被压缩,您还必须自己解码.

If you want that kind of functionality you'll have to implement it yourself. That is; as you start playback of sounds, mix them and write the result to a file as well. If the sounds are compressed you'll also have to take case of decoding them yourself.

请注意,Android 中不包含 MP3 编码器,因此如果要导出的格式是您自己的 MP3 编码器,则无论如何您都必须提供.

Note that there's no MP3 encoder included with Android, so you'd have to supply your own MP3 encoder anyway if that's the format you want to export in.

这篇关于录制/捕获Android应用程序的内部声音播放并导出mp3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆