sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* compression
@ 2017-12-06 22:39 Glenn English
  2017-12-06 23:29 ` compression Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn English @ 2017-12-06 22:39 UTC (permalink / raw)
  To: sox-users

I want to compress some audio -- the quiet parts are too quiet for a road trip.

AFAICT, there are 2 compression effects: compand and contast.

Compand doesn't seem to have a ratio param. Contrast isn't explained
in much detail, and it doesn't have much at all in the way of params
anyway.

Can anyone explain to me how to get sox to do a simple compression
with an adjustable compression ratio?

--
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] 3+ messages in thread

* Re: compression
  2017-12-06 22:39 compression Glenn English
@ 2017-12-06 23:29 ` Jeremy Nicoll - ml sox users
  2017-12-06 23:33   ` compression Glenn English
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2017-12-06 23:29 UTC (permalink / raw)
  To: sox-users

On 2017-12-06 22:39, Glenn English wrote:
> I want to compress some audio -- the quiet parts are too quiet for a 
> road trip.
> 
> AFAICT, there are 2 compression effects: compand and contast.
> 
> Compand doesn't seem to have a ratio param. Contrast isn't explained
> in much detail, and it doesn't have much at all in the way of params
> anyway.
> 
> Can anyone explain to me how to get sox to do a simple compression
> with an adjustable compression ratio?

The manual has a specific example of the use of compand, for making 
music
suitable for listening to in a car.  I'd have thought you could start by
trying the example, then tweaking the settings to suit your music.

In the description of the parameters in that example, it says "sounds in
the range −60dB to 0dB (maximum volume) will be boosted so that the 60dB
dynamic range of the original music will be compressed 3-to-1 into a 
20dB
range".  I presume that the 3:1 ratio and those quoted 60dB & 20dB 
values
correspond to the "-60" and "-20" parameters in the example.

I guess you might need to use the stat/stats effects to discover the
dynamic range of a piece of music first, to work out eg the values of
the overall gain, if any, to be applied.


As is often the case in sox documentation, it requires a very careful
look at the required and optional parms for the effect, with the 
example,
to see which parts have been provided.  I found for example when I first
looked at this that I (wrongly) thought that where the description shows
that attack1,decay1 might be followed by  attack2,decay2  and on the 
line
below shows that  in-dB1,out-dB1 might be followed by in-dB2,out-dB2 
that
those two sets of optional second instances of parameters were connected
ie if you had multiple sets of attach,delay, you needed multiple sets of
in&out dBs.

They're not.  Moreover, in the example the 'transfer function' is given
as: 6:−70,−60,−20  and it took me a while to realise that that 
corresponds
to: [soft-knee-dB:]in-dB1[,out-dB1]{,in-dB2,out-dB2}   with out-dB1 (as 
it
says it can be) omitted.  I think the example would have been easier to
understand if it was coded as: 6:−70,-70,−60,−20 (which is what I think
it actually means).   I may well be wrong!

-- 
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
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] 3+ messages in thread

* Re: compression
  2017-12-06 23:29 ` compression Jeremy Nicoll - ml sox users
@ 2017-12-06 23:33   ` Glenn English
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn English @ 2017-12-06 23:33 UTC (permalink / raw)
  To: sox-users

On Wed, Dec 6, 2017 at 11:29 PM, Jeremy Nicoll - ml sox users
<jn.ml.sxu.88@wingsandbeaks.org.uk> wrote:

> The manual has a specific example of the use of compand, for making music
> suitable for listening to in a car.  I'd have thought you could start by
> trying the example, then tweaking the settings to suit your music.
>
> In the description of the parameters in that example, it says "sounds in
> the range −60dB to 0dB (maximum volume) will be boosted so that the 60dB
> dynamic range of the original music will be compressed 3-to-1 into a 20dB
> range".  I presume that the 3:1 ratio and those quoted 60dB & 20dB values
> correspond to the "-60" and "-20" parameters in the example.

Sorry and thanks. I missed that...

--
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] 3+ messages in thread

end of thread, other threads:[~2017-12-06 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 22:39 compression Glenn English
2017-12-06 23:29 ` compression Jeremy Nicoll - ml sox users
2017-12-06 23:33   ` compression Glenn English

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).