Reducing/removing clipping in SoX when converting the sample rate

蹲街弑〆低调 提交于 2019-11-30 10:53:06
user871634

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:

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

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).

I had the issue. Changing the encoding of the wav file fixed it:

sox input.wav -e signed-integer output.wav
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!