红袜:合并垫两个音频文件 [英] Sox : merge two audio files with a pad
问题描述
我使用了 SOX
的工具,我想为合并两个音频文件,假设长。 OGG
和 short.ogg
来输出文件 output.ogg
。
这是很容易的使用 $ SOX -m long.ogg short.ogg output.ogg
。
I'm using the sox
tool and I would like to merge two audio files, let's say long.ogg
and short.ogg
to output a file output.ogg
.
This is very easy using $ sox -m long.ogg short.ogg output.ogg
.
事情是,我想在 short.ogg
为 n秒后打出(而 long.ogg
应该从头开始右)。要做到这一点,我发现的垫的效果。但我不明白的语法延迟只有 short.ogg
输入文件,而不是 long.ogg
单
Thing is, I would like the short.ogg
to be played after n seconds (while long.ogg
should start right from the beginning). To do so, I've found the pad effect. But I don't understand the syntax to delay only the short.ogg
input file, not the long.ogg
one.
我发现这样做(其中n = 6)的(肮脏)的方式:
I found a (dirty) way of doing so (with n=6):
$ sox short.ogg delayed.ogg pad 6
$ sox -m long.ogg delayed.ogg output.ogg
我想不会有创建的中间文件。在此先感谢您的帮助。
I would like not to have to create an intermediate file. Thanks in advance for your help.
推荐答案
感谢icyrock,我设法找到一个解决方案。我使用的是:
Thanks to icyrock, I managed to find a solution. I'm using:
$ sox short.ogg -p pad 6 0 | sox - -m long.ogg output.ogg
对于多音轨(学分奥兰多):
For multi tracks (credits to Orlando):
$ sox starts-last.mp3 -p pad 2 0 | sox - -m starts-second.mp3 -p pad 2 0 | sox - -m starts-first.mp3 combined.mp3
这篇关于红袜:合并垫两个音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!