编辑:我想使用libsox程序转换一个wav文件的样本率,音频格式,频道等。
在libsox手册页面中,有很多函数我可以使用,但是我对该做什么一无所知。有人能告诉我怎么做吗?
帮助?
有人能解释一下吗?
The function sox_write writes len samples from buf using the format
handler specified by ft. Data in buf must be 32-bit signed samples and
will be converted during the write process. The value of len is speci-
fied in total samples. If its value is not evenly divisable by the num-
ber of channels, undefined behavior will occur.发布于 2009-10-18 23:28:33
我建议使用libsndfile和libsamplerate的组合。
http://www.mega-nerd.com/SRC
SRC提供了一组小的转换器,以使质量可以与计算成本进行权衡。在给定的输入和输出采样率下,电流最佳转换器提供的信噪比为145 DC,通带范围为-3dB,从理论上的最佳带宽的96%扩展到理论上的最佳带宽。
http://www.mega-nerd.com/libsndfile/
)
发布于 2009-02-05 01:29:58
好吧,我猜你的问题和最后一句有关。如果您有一个交错缓冲区,则缓冲区中的样本数必须根据通道数进行可除,因为这是您将要写入的每个通道样本的数量。例如,假设您有L和R通道;缓冲区上的数据如下所示:
[0] 1st sample - L
[1] 1st sample - R
[2] 2nd sample - L
[3] 2nd sample - R
...
[n-1] n/2-th sample - L
[n] n-th sample - R希望能帮上忙。
https://stackoverflow.com/questions/514061
复制相似问题