结合Java中的多声流 [英] Combining multiple sound streams in Java
问题描述
我公司拥有一批在PCM,我想通过网络发送语音声音流连接codeD(PCM_SIGNED 8000.0赫兹,16位,单声道,2个字节/帧,小端)的。为了节省带宽我目前带code。使用JSpeex流。然而,为了节省更多的带宽我想(如果可能的话)与JSpeex编码之前这些多个流合并成单个流。我DSP知识严重缺乏和放大器;我想知道如何去流在Java中结合?
I have a number of voice sound streams encoded in PCM (PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian) which I want to send over the network. To save bandwidth I currently encode the streams using JSpeex. However to save even more bandwidth I would like to (if possible) combine these multiple streams into a single stream before encoding with JSpeex. My DSP knowledge is severely lacking & I am wondering how to go about combining the streams in Java?
推荐答案
我将多个音频流与此的 MixingAudioInputStream 。上面提到的AudioConcat例使用相同的类和它给你怎么办混合是个好主意。
I combine multiple audio streams with this MixingAudioInputStream. The mentioned AudioConcat example uses the same class and it gives you a good idea of how to do the mixing.
您把它选定格式的AudioInputStream对象的列表和它混合下来成一个混合的AudioInputStream,您可以发送回客户端。
You hand it a chosen format and a List of AudioInputStream objects and it mixes them down into one mixed AudioInputStream that you can send back to the clients.
我发现它工作得很好,只要你输入流的长度都或多或少大小相同的长度。
I found it works well provided that your input stream lengths are more or less the same size in length.
这篇关于结合Java中的多声流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!