Trying to Split Wav file into two pieces with SoX

跟風遠走 提交于 2019-12-10 20:14:23

问题


I'm trying to split one .wav file into two pieces where there is a few seconds of silence. Based on the documentation I've found, the following should work:

 sox testfile.wav tester.wav silence 1 0.50 0.1% 1 1.0 0.1% : newfile : restart

"testfile.wav" is a voice recording and I put about 4 seconds of silence right in the middle of it to test. The expected result is that I would get "tester001.wav" and "tester002.wav" from running this. Instead I get one file - "tester.wav" which is the first part of the original file (right up to the silence). I'm wondering how to make it continue and make a new file from the part AFTER the silence.

I found this: sox fails to split files on StackOverflow, but the accepted answer to that question did not change it for me (changing the seconds to 3.0 gave me the same results, since I have a four second gap. It still didn't give me the second audio file.)

Any help would be appreciated!


回答1:


Ha! Well it turns out the version of SoX that was running on my server was ancient, which was the problem. After updating to the current version, all works as expected. :)



来源:https://stackoverflow.com/questions/16125614/trying-to-split-wav-file-into-two-pieces-with-sox

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