本文介绍了分裂的Speex音频数据 - WebAudio - VOIP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

进出口运行一个小的应用程序,连接codeS和德codeS的音频数组在JavaScript中的Speex codeC:的

Im running a little app that encodes and decodes an audio array with the speex codec in javascript: https://github.com/dbieber/audiorecorder

有小阵充满罪恶的波形

for(var i=0;i<16384;i++)
    data.push(Math.sin(i/10));

这工作。但是,我要建立一个VOIP应用,并有多个阵列。所以,如果我在第2部分连接code>德code>合并分割我的数组时,它听起来并不像以前一样。

this works. But I want to build a VOIP application and have more than one array. So if I split my array up in 2 parts encode>decode>merge, it doesn't sound the same as before.

看看这个:

提琴:

两个按钮应该给予相同的音频输出

Both buttons should give the same audio output.

我怎样才能在这两个方面相同的输出?是他们为speex.js拆分音频数据的特殊模式?

How can i get the same output in both ways ? Is their a special mode in speex.js for split audio data?

推荐答案

注意的Speex是。因此,根据定义,它不能给出相同的结果烯$ C $光盘缓冲器。此外,它设计为语音一个$ C $立方厘米。所以1-2千赫范围将是最有效的,因为它预期信号的特定形式。在某种程度上,它可以比的JPEG技术的光栅图像。

Note that Speex is a lossy codec. So, by definition, it can't give same result as the encoded buffer. Besides, it designed to be a codec for voice. So the 1-2 kHz range will be the most efficient as it expects a specific form of signal. In some way, it can be compared to JPEG technology for raster images.

我已经稍微修改您的的,因此您可以使用不同的参数玩,比较结果。只是提供了一个简单的正弦曲线与未知频率不检查一个codeC有道。然而,在该示例可以看到在不同频率的初始信号不同的影响。

I've modified slightly your jsfiddle example so you can play with different parameters and compare results. Just providing a simple sinusoid with an unknown frequency is not a proper way to check a codec. However, in the example you can see different impact on the initial signal at different frequency.

buffer1.push(Math.sin(2*Math.PI*i*frequency/sampleRate));

我想你应该建立一个例子录有声音,在这种情况下,比较结果。这将是更合适的。

I think you should build an example with a recorded voice and compare results in this case. It would be more proper.

在一般获得详细你必须检查的数字信号处理的想法。我甚至不能提供一个适当的链路,因为它是一个整体的科学,它在数学上是密集的。 (唯一正确的书阅读我所知道的是在)。如果具有较强的数学背景的人在这里可以为这种情况下,适当分享我的文学AP会preciate。

In general to get the idea in detail you would have to examine digital signal processing. I can't even provide a proper link since it is a whole science and it is mathematically intensive. (the only proper book for reading I know is in Russian). If anyone here with strong mathematics background can share proper literature for this case I would appreciate.

编辑:如黑井ネ所提到的,存在与缓冲器的边界的麻烦。而且看起来它是不可能的,因为在这个提到拯救德codeR状态,因为在使用该库不支持它。如果你看一下源$ C ​​$ C你看,他们使用第三方的Speex codeC,不能提供完全访问它的功能。我认为最好的办法是找到一个的Speex像样的图书馆,支持类似于这个

as mentioned by Kuroi Neko, there is a trouble with the boundaries of the buffer. And seems like it is impossible to save decoder state as mentioned in this post, because the library in use doesn't support it. If you look at the source code you see that they use a third party speex codec and do not provide full access to it's features. I think the best approach would be to find a decent library for speex that supports state recovery similar to this

这篇关于分裂的Speex音频数据 - WebAudio - VOIP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!