还原/删除在使用SoX剪辑转换采样率时, [英] Reducing/removing clipping in SoX when converting the sample rate

查看:4540
本文介绍了还原/删除在使用SoX剪辑转换采样率时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用使用SoX一组wav文件修剪成16kHz的,16位,单声道的WAV文件(这将是最初的wav文件的一个子集)。大多数源wav文件都已经设置此规范,但是,我刚刚发现其中一些具有不同的采样率。因为它会使用的ProcessBuilder在Java中实现自动化,我想我可以使用下面的命令:

I'm using SoX to trim a set of wav files into 16kHz, 16bit, mono channel wav files (which will be subsets of one of the initial wav files). Most of the source wav files are already set to this specification, however, I just found out that some of them have different sample rates. Since it's going to be automated in Java using a ProcessBuilder, I figured I could use the following command:

sox <source_wav> -b 16 <dest_wav> channels 1 rate 16000 trim <startTime> =<endTime>

和如果不是16000赫兹它只会改变采样率。它做什么,它应该与同规格的文件,但对不同采样率的文件,我得到:

and it'll only change the sample rate if it isn't 16000 Hz. It does what it's supposed to on files with the same specification, but on files with different sample rates, I get:

sox WARN rate: rate clipped 48 samples; decrease volume?
sox WARN dither: dither clipped 44 samples; decrease volume?

我应该如何处理这种不降低音频的质量?请注意,我不知道信号处理的事情。

How should I deal with this without degrading the quality of the audio? Note that I don't know anything about signal processing.

推荐答案

由于所建议的工具,请尝试减少体积小,例如用-v 0.99(或0.98等)preceding。在这种体积小的变化是潜移默化的。如果仍然出现削波,然后将音频很可能严重削波(即disorted)一起开始(这是与现代音乐常见;见百科:响度战争)等的警告可以忽略,没有额外的失真引入。

As suggested by the tool, try reducing the volume slightly, e.g. by preceding with -v 0.99 (or 0.98 etc.). Such small changes in volume are imperceptible. If you still get clipping then the audio is likely severely clipped (i.e. disorted) to begin with (this is common with modern music; see Wikipedia: Loudness war) and so the warnings can be ignored—no additional distortion is being introduced.

正如评论中提到,可以给出-G选项,它会自动进行任何调整,以避免裁剪所需的体积(在一些额外的CPU时间为代价的,即它稍微慢一点与-G运行)。

As mentioned in the comments, the -G option can be given which will automatically make any adjustment to the volume needed to avoid clipping (at the expense of a little extra CPU time, i.e. it runs slightly slower with -G).

这篇关于还原/删除在使用SoX剪辑转换采样率时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆