淡入淡出的一组音频文件与SOX剪接 [英] crossfading a group of audio files with sox splice

查看:667
本文介绍了淡入淡出的一组音频文件与SOX剪接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够加入并使用使用SoX交叉衰减两个音频文件,像这样:

I am able to join and crossfade two audio files using SoX, like so:

sox file1.wav file2.wav outfile.wav splice -q `soxi -D file1.wav`,0.5

其中soxi取代是撷取的file1和0.5的持续时间是交叉衰落的长度。现在我想这与之间的短淡入淡出一起延伸到文件的任意数量的,为了把它们串。这里似乎是2的方法:管道和脚本。红袜有一个-p选项告诉它把它的输出管道(而不是写文件)。但是,每个命令多个输入和参数,目前还不清楚该如何输出(的输入?)在随后的命令被分配。到目前为止,我已经得到了下面的线,不起作用,试图扩展到3个文件。

where the soxi substitution is fetching the duration of file1 and 0.5 is the length of the cross-fade. I am now trying to extend this to an arbitrary number of files, in order to string them together with short crossfades in between. There would seem to be 2 approaches: piping and scripting. Sox has a -p option telling it to treat it's output as piped (instead of writing a file). But, with many input and arguments per command, it's not clear how that output (and input?) gets assigned in subsequent commands. So far I've got the line below, which does not work, trying to extend to 3 files.

sox -p file1.wav file2.wav splice -q `soxi -D file1.wav`,0.5 | sox -p file3.wav outfile.wav splice -q `soxi -D file3.wav`,0.5

您对SOX管道和​​脚本提示将不胜AP preciated。

Your tips on sox piping and scripting would be greatly appreciated.

推荐答案

我已经得到了大部分的方式出现以

I have gotten most of the way there with

sox --combine concatenate *.wav _merge.wav splice -q 3,1

在末端的接合效果放置交叉衰落以3秒进第一文件的开始,并使用1个第二跨衰落持续时间(半秒在开始和两个文件结束)。这个方法是我可以选择只包括〜3在我的第二个输出文件(使用其他方法)一个临时的解决。
一个更好的答案会弄清楚如何抓住当前的文件和替代的持续时间代替3。

The splice effect at the end places the beginning of the cross-fade at 3 seconds into the first file, and uses 1 second as cross-fade duration (half second at beginning and end of two files). This method is a temporary fix as I can choose to include only ~3 second files in my output (using other methods). A better answer would figure out how to grab duration of current file and substitute that in place of the 3.

sox --combine concatenate *.wav _merge.wav splice -q $(soxi −D {}),1

如果该{}此处选择的当前项目(在为找到),这将做到这一点。但是,这似乎并没有工作。

If the {} here selected the current item (as in find), that would do it. But that doesn't seem to work.

这篇关于淡入淡出的一组音频文件与SOX剪接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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