Discussion:
[SoX-devel] [SoX-users] time dependent gain
Schumacher Marlon
2014-05-31 21:52:40 UTC
Permalink
Hi there,

I was also wishing for this kind of functionality (envelopes or breakpoint functions), but afaik this is currently not possible with sox. It seems currently you can only get there by trimming->processing->splicing together again - which I also found rather cumbersome and less accurate
-> but maybe someone on this list could give a simple example/workaround how to do this. Ecasound can do dynamic parameter changes during processing.

Don't know if this would be very hard to do (I think there has been a suggestion to use a 'control signal' for dynamic control)... maybe one possibility might be to point to a textfile (instead of the value) which describes a breakpoint function as time-value tuplets (X being time, Y being the value). This breakpoint function could be sampled (with linear interpolation) according to a rate set as a preference option (which could have a default, perhaps one signal buffer).

For example:

sox infile.wav outfile.wav vol --bpf-file.txt

The "bpf-file" could look like this:

X Y
0 0
2.5 0.5
3.5 0.25
4 0

Cheers,
Marlon

PS Also forwarding this to the devel-list (for reference, who knows, perhaps it might be useful/considered ;)
Hi,
is there a way to apply a time-dependent gain?
I got some recordings with rather quiet parts in between, which I want
to enhance. I do _not_ want to compress the whole recording, only apply
0db until time t1, then smoothly up to x db at time t2, then constant
gain x until time t3, then smoothly down to 0db at time t4 and then
constant 0db until the end.
If possible, it would be nice to determine "x" by the volume level in
that range, but I could live without.
- cut into multiple files (I'm doing this anyways)
- take "1 sec. silence" + "t2 - t3" + "1 sec silence", amplify this by x
dB, fade in & out with somewhat complex calculated durations, trim away
the first and last second
But this seems rather complicated for a task, which I assume is quite
common.
Applying "compand" only for the relevant track from t2 to t3 is not
useful for me, because then I get a "gain-step" at t3 from x db to 0 db
which is annoying.
Greetings,
Erich
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet_______________________________________________
Sox-users mailing list
https://lists.sourceforge.net/lists/listinfo/sox-users
Loading...