我正在使用 SoX 将一组 wav 文件修剪为 16kHz、16 位、单声道 wav 文件(这将是其中一个初始 wav 文件的子集)。大多数源 wav 文件已经设置为该规范,但是,我刚刚发现其中一些文件具有不同的采样率。由于它将使用 ProcessBuilder 在 Java 中实现自动化,我想我可以使用以下命令:
sox <source_wav> -b 16 <dest_wav> channels 1 rate 16000 trim <startTime> =<endTime>
并且只有在采样率不是 16000 Hz 时才会更改采样率。它对具有相同规格的文件执行其应有的操作,但对于具有不同采样率的文件,我得到:
sox WARN rate: rate clipped 48 samples; decrease volume?
sox WARN dither: dither clipped 44 samples; decrease volume?
我应该如何处理这个问题而不降低音频质量?请注意,我对信号处理一无所知。
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>
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.
发布评论
评论(2)
按照该工具的建议,尝试稍微减小音量,例如在前面加上 -v 0.99(或 0.98 等)。如此微小的体积变化是难以察觉的。
示例:
如果仍然出现削波,那么音频可能一开始就被严重削波(即扭曲)(这在现代音乐中很常见;请参阅维基百科:响度战争),因此可以忽略警告 - 不会引入额外的失真。
正如评论中提到的,可以给出 -G 选项,它将自动对避免削波所需的音量进行任何调整(以一点额外的 CPU 时间为代价,即使用 -G 时运行速度稍慢)。
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.
Example:
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.
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).
我有这个问题。更改 wav 文件的编码修复了该问题:
I had the issue. Changing the encoding of the wav file fixed it: