SoX(Sound eXchange)或ffmpeg中的信封样式 [英] Envelope pattern in SoX (Sound eXchange) or ffmpeg

查看:94
本文介绍了SoX(Sound eXchange)或ffmpeg中的信封样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用SoX产生白噪声.我正在采用一种将在整个轨道上调节音量的方式,该方式将创建类似于以下内容的模式:

I've been using SoX to generate white noise. I'm after a way of modulating the volume across the entire track in a way that will create a pattern similar to this:

白噪声包络效应

我已经尝试了淡入淡出,但是淡入淡出到100%的体积,然后淡出到0%的体积,在这种情况下,这只是一种痛苦.

I've experimented with fade, but that fades in to 100% volume and fades out to 0% volume, which is just a pain in this instance.

颤音效果也不尽如人意,因为图案的频率会随着时间而变化.

The tremolo effect isn't quite what I'm after either, as the frequency of the pattern will be changing over time.

唯一的另一种选择是将白噪声文件拆分为单独的文件,应用淡入淡出,然后在任一端进行修剪,这样就不会完全淡入淡出,但这似乎是很多不必要的处理.

The only other alternative is to split the white noise file into separate files, apply fade and then apply trim to either end so it doesn't fade all the way, but this seems like a lot of unnecessary processing.

我一直在检查此示例

I've been checking out this example Using SoX to change the volume level of a range of time in an audio file, but I don't think it's quite what I'm after.

我正在Ubuntu和SoX中使用命令行,但是我对ffmpeg或任何其他基于Linux的命令行解决方案持开放态度.

I'm using the command-line in Ubuntu with SoX, but I'm open to suggestions with ffmpeg, or any other Linux based command-line solution.

推荐答案

使用ffmpeg,您可以使用音量过滤器

With ffmpeg, you could use the volume filter

ffmpeg -i input.wav -af \
"volume='if(lt(mod(t\,5)/5\,0.5), 0.2+0.8*mod(2*t\,5)/5\, 1.0-0.8*mod(t-(5/2)\,5)/(5/2))':eval=frame" \
  output.wav

上面过滤器中的表达式在t = 0到t = 2.5秒之间将音量从0.2增大到1.0,然后在t = 5秒逐渐减小到0.2.信封的时间为5秒.

The expression in the filter above, increases the volume from 0.2 to 1.0 over t=0 to t=2.5 seconds, then gradually back down to 0.2 at t=5 seconds. The period of the envelope here is 5 seconds.

这篇关于SoX(Sound eXchange)或ffmpeg中的信封样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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