录制/捕获Android应用程序的内部声音播放并导出mp3?

编程入门 行业动态 更新时间:2024-10-26 12:28:17
本文介绍了录制/捕获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?

本文发布于:2023-11-23 15:38:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621984.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   声音   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!