尝试使用 SoX 将 Wav 文件分成两部分 [英] Trying to Split Wav file into two pieces with SoX

查看:58
本文介绍了尝试使用 SoX 将 Wav 文件分成两部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一个 .wav 文件分成两部分,其中有几秒钟的沉默.根据我找到的文档,以下应该有效:

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" 是一段录音,我在它中间放置了大约 4 秒的静音进行测试.预期的结果是我会通过运行它得到tester001.wav"和tester002.wav".相反,我得到了一个文件 - tester.wav",它是原始文件的第一部分(一直到静音).我想知道如何让它继续并从沉默之后的部分制作一个新文件.

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

我发现了这个:sox 无法在 StackOverflow 上拆分文件,但已接受这个问题的答案对我来说没有改变(将秒更改为 3.0 给了我相同的结果,因为我有四秒的差距.它仍然没有给我第二个音频文件.)

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

任何帮助将不胜感激!

推荐答案

哈!事实证明,在我的服务器上运行的 SoX 版本很旧,这就是问题所在.更新到当前版本后,一切正常.:)

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

这篇关于尝试使用 SoX 将 Wav 文件分成两部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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