在 Android 上使用 MediaPlayer 作为源录制音频?
在 Android 上,您可以使用 MediaRecorder 类从麦克风录制音频: MediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
我想录制 MediaPlayer 实例(或其他音频播放设备)播放的音频的某些部分。这可能吗?如何设置自定义音频源?
总结一下; 如何将音频从任意音频源流式传输到 MediaRecorder 中?
On Android, you can record audio from the microphone using the MediaRecorder class:
MediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
I want to record some parts of audio being played by a MediaPlayer instance instead (or some other audio playback device). Is that possible? How would I set a custom audio source?
To summarize; how do I stream audio into the MediaRecorder from an arbitrary audio source?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为目前还没有 API 可以实现这一点。尽管这是可能的,但您必须能够访问设备的缓冲区,直至内核/硬件级别。即使您找到了一种方法,我认为 Android 也不会授予您在应用程序级别执行此操作的权限。
I don't think there is an API for that for now. Though it IS possible, you would have to have access to the device's buffer, down to the kernel/hardware level. Even if you find a way, I don't think Android would give you permission to do this on application level.