如何复制Android的AudioSource.MIC? [英] How to duplicate Android AudioSource.MIC?
问题描述
我要同时录制两个AudioRecord对象的Android麦克风输入。有没有办法复制了Android AudioSource.MIC或使其同时从两个实例访问?如果是的话,我怎么能这样做呢?
I want to record the Android microphone input simultaneously in two AudioRecord objects. Is there a way to duplicate the Android AudioSource.MIC or make it accessible from two instances simultaneously? If yes, how could I do this?
推荐答案
您不能在Android中做到这一点。事实上,你不能复制,当一个实例已在运行的任何记录实例,这适用于摄像头以及麦克风。
在输出的情况下,如音频播放(和视频显示),有模块来处理多个数据流,混合,重新取样等(作曲,渲染显示)。
You cannot do this in android. In fact you cannot duplicate any record instance when one instance is already running , this applies to camera as well as mic. In case of output , like audio playout (and video display) there are modules to handle multiple streams, mix , resample etc (composing, rendering for display).
如果您有充分的Android源$ C $ C为您的设备,你可以尝试写一个缓冲机制,但不是通用的,可扩展的,并不简单。
If you have the full android source code for your device,you can try to write a buffering mechanism, but that is not generic, scalable and is not simple.
在一般如果记录对象实例被打开,并举行由其它应用程序,有没有什么可以做其他的,而不是显示错误消息。
(快速实验 - 在后台录制音频和键盘打开语音转换器,它抛出了一个错误)
In general if the recording object instance is opened and held by another application, there is nothing much you can do other than to display an error message. (Quick experiment- Record audio in the background and open the speech converter in your keyboard, it throws up an error)
这篇关于如何复制Android的AudioSource.MIC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!