sox-users@lists.sourceforge.net unofficial mirror
 help / color / Atom feed
* which is better / more effective
@ 2017-11-25 18:50 Glenn English
  2017-11-25 19:28 ` James Trammell
  2017-11-26 12:36 ` Måns Rullgård
  0 siblings, 2 replies; 5+ messages in thread
From: Glenn English @ 2017-11-25 18:50 UTC (permalink / raw)
  To: sox-users

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)

--
Glenn English

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: which is better / more effective
  2017-11-25 18:50 which is better / more effective Glenn English
@ 2017-11-25 19:28 ` James Trammell
  2017-11-26 12:04   ` Måns Rullgård
  2017-11-26 12:36 ` Måns Rullgård
  1 sibling, 1 reply; 5+ messages in thread
From: James Trammell @ 2017-11-25 19:28 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 1793 bytes --]

Hi,

Myself being new to SoX and unfamiliar with the code, my advice would be to
try all three ways, then run a few tests to find any bad behavior. Trust,
but verify.

file A = one call with several switches.
file B = several calls with one switch.
file C = several calls with one switch, piped together.

Null test

Invert the phase of B, combine with A, listen for problems.
Invert the phase of C, combine with A, listen for problems.
Invert the phase of C, combine with B, listen for problems.

Spectrograph

I would also load files A, B and C into spectrograph software to see what
information is present at the very bottom bits of the bit depth.

Try the conversions without dither to see if the spectrographs show
different levels of truncation noise.

-James




On Sat, Nov 25, 2017 at 1:50 PM, Glenn English <ghe2001@gmail.com> wrote:

> 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)
>
> --
> Glenn English
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

[-- Attachment #1.2: Type: text/html, Size: 2702 bytes --]

<div dir="ltr"><div><div>Hi,</div><div><br></div><div>Myself being new to SoX and unfamiliar with the code, my advice would be to try all three ways, then run a few tests to find any bad behavior. Trust, but verify.</div><div><br></div><div>file A = one call with several switches.</div><div>file B = several calls with one switch.</div><div>file C = several calls with one switch, piped together.</div><div><br></div><div>Null test</div><div><br></div><div>Invert the phase of B, combine with A, listen for problems.</div><div>Invert the phase of C, combine with A, listen for problems.</div><div>Invert the phase of C, combine with B, listen for problems.</div><div><br></div><div>Spectrograph</div><div><br></div><div>I would also load files A, B and C into spectrograph software to see what information is present at the very bottom bits of the bit depth.</div><div><br></div><div>Try the conversions without dither to see if the spectrographs show different levels of truncation noise.</div><div><br></div><div>-James</div></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 25, 2017 at 1:50 PM, Glenn English <span dir="ltr">&lt;<a href="mailto:ghe2001@gmail.com" target="_blank">ghe2001@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m getting ready to ask sox to do several things: EQ, compression,<br>
normalization, speed change, etc. I see on the web, suggestions of<br>
several different ways to do this: make one call to sox with several<br>
switches, make several calls to sox with one switch, or pipe those<br>
several calls together.<br>
<br>
Which of these works best? Does it matter? Does sox just figure all<br>
this out and fork several times if it needs to? (multi-core CPU and<br>
lots of RAM on Debian Linux, and the file is ~1G FLAC, if any of that<br>
makes any difference)<br>
<br>
--<br>
Glenn English<br>
<br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world&#39;s most<br>
engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
______________________________<wbr>_________________<br>
Sox-users mailing list<br>
<a href="mailto:Sox-users@lists.sourceforge.net">Sox-users@lists.sourceforge.<wbr>net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/sox-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sox-users</a><br>
</blockquote></div><br></div>

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: which is better / more effective
  2017-11-25 19:28 ` James Trammell
@ 2017-11-26 12:04   ` Måns Rullgård
  0 siblings, 0 replies; 5+ messages in thread
From: Måns Rullgård @ 2017-11-26 12:04 UTC (permalink / raw)
  To: James Trammell; +Cc: sox-users

James Trammell <james.trammell@gmail.com> writes:

> Hi,
>
> Myself being new to SoX and unfamiliar with the code, my advice would be to
> try all three ways, then run a few tests to find any bad behavior. Trust,
> but verify.
>
> file A = one call with several switches.
> file B = several calls with one switch.
> file C = several calls with one switch, piped together.
>
> Null test
>
> Invert the phase of B, combine with A, listen for problems.
> Invert the phase of C, combine with A, listen for problems.
> Invert the phase of C, combine with B, listen for problems.
>
> Spectrograph
>
> I would also load files A, B and C into spectrograph software to see what
> information is present at the very bottom bits of the bit depth.
>
> Try the conversions without dither to see if the spectrographs show
> different levels of truncation noise.

Before going to all that trouble, just compare the three files and see
if they differ at all.  If the output precision is less than 24 bits, it
will have dither automatically applied (unless disabled with the -D flag),
so for such a test the -R flag should be used to select a fixed seed for
the dither RNG.

-- 
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
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: which is better / more effective
  2017-11-25 18:50 which is better / more effective Glenn English
  2017-11-25 19:28 ` James Trammell
@ 2017-11-26 12:36 ` Måns Rullgård
  2017-12-01 18:03   ` Glenn English
  1 sibling, 1 reply; 5+ messages in thread
From: Måns Rullgård @ 2017-11-26 12:36 UTC (permalink / raw)
  To: Glenn English; +Cc: sox-users

Glenn English <ghe2001@gmail.com> 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
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: which is better / more effective
  2017-11-26 12:36 ` Måns Rullgård
@ 2017-12-01 18:03   ` Glenn English
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn English @ 2017-12-01 18:03 UTC (permalink / raw)
  To: sox-users

On Sun, Nov 26, 2017 at 12:36 PM, Måns Rullgård <mans@mansr.com> wrote:

> 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.

Thank you. The pipes seemed the simplest way (the way my program is
being written), but sox is pretty new to me...

--
Glenn English

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 18:50 which is better / more effective Glenn English
2017-11-25 19:28 ` James Trammell
2017-11-26 12:04   ` Måns Rullgård
2017-11-26 12:36 ` Måns Rullgård
2017-12-01 18:03   ` Glenn English

sox-users@lists.sourceforge.net unofficial mirror

Archives are clonable: git clone --mirror https://public-inbox.org/sox-users

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.sox
	nntp://news.gmane.org/gmane.comp.audio.sox

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox