Re: which is better / more effective

Måns Rullgård <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <[email protected]>
Glenn English <[email protected]> writes:

> I'm getting ready to ask sox to do several things: EQ, compression,
> normalization, speed change, etc. I see on the web, suggestions of
> several different ways to do this: make one call to sox with several
> switches, make several calls to sox with one switch, or pipe those
> several calls together.
>
> Which of these works best? Does it matter? Does sox just figure all
> this out and fork several times if it needs to? (multi-core CPU and
> lots of RAM on Debian Linux, and the file is ~1G FLAC, if any of that
> makes any difference)

Sox has very limited support for multi-processing built-in, and it
doesn't work very well.  For a long effects chain, you'll get better
throughput by piping multiple processes.

If you have a single command like this:

  sox in.flac out.flac effect1 effect2 effect3

it can be split up like this:

  sox in.flac -p effect1 | sox -p -p effect2 | sox -p out.flac effect3

The end result should be exactly the same.

It probably doesn't make sense to put light-weight effects in a separate
command as the extra inter-process copying could easily negate any
gains.

-- 
Måns Rullgård

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.