我有一个 10 分钟的音频,我想将其分成几个时间 block ,如下所示: (格式为mm:ss.frac)
1. 1.wav -> 00.000 - 20.271
2. 2.wav -> 20.272 - 47.550
3. 3.wav -> 47.551 - 01:20.562
我尝试像这样使用trim
命令
sox infile outfile trim 0.000 20.271
However the format istrim start [length]
最坏的情况,我将不得不计算各个 block 的持续时间。还有别的办法吗?
最佳答案
我发现最简单的解决方案是这样编写命令:
sox infile outfile start =end
在到达开始位置之前,音频不会发送到输出流,并且可以通过使用带有结束时间的“=”符号来指定结束位置。
因此,代码现在将是:
sox forth.wav 10.wav trim 303.463 =353.790
trim start [length|=end] The optional length parameter gives the length of audio to output after the start sample and is thus used to trim off the end of the audio. Alternatively, an absolute end location can be given by preceding it with an equals sign. Using a value of 0 for the start parameter will allow trimming off the end only.
关于batch-processing - 如果开始和结束时间已知,则使用 SoX 制作音频文件 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32730817/