Doug Cook | 1 Jan 2010 06:59
Picon

Re: Automatic Gain Control

On Thu, Dec 31, 2009 at 7:25 AM, Jan Stary <hans <at> stare.cz> wrote:
> > I would like to be able to have some sort of automatic gain
> > control in sox when processing voice files..

Given it's voice files, you might also want to try
speexenc(1), which apparently has an AGC option:

        --agc Apply adaptive gain control (AGC) before encoding

(Haven't used it myself, though)
Yes, this is the "speexdsp" library I mentioned earlier. If you use speexenc as-is, it encodes your audio to speex format, but you can use the speexdsp library without using the speex format.
 
I've got a private patch to sox that adds a "speexdsp" effect so that you can use the speex AGC and noise reduction filters by themselves (without encoding to speex format). I don't know if the speex AGC is any better or worse than the existing compand effect, but it only takes one parameter (target volume from 0-100%) so it is easier to get something working that sounds reasonable. I don't really know what algorithm speexdsp uses for noise reduction, but it seems to work better than the existing noisered effect for reducing generic background noise and doesn't require any training or parameter adjustment. Unfortunately, it seems to introduce the occasional "pop" into the signal.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Jan Stary | 3 Jan 2010 16:21
Picon

Re: 14.3.1.rc2 on OpenBSD - sndio problems

On Dec 29 18:26:07, Chris Bagwell wrote:
> On Tue, Dec 29, 2009 at 7:52 AM, Jan Stary <hans <at> stare.cz> wrote:
> 
> > Trying to run 14.3.1rc2 on OpenBSD 4.6.
> > ./configure && make works OK when using
> >
> > env     \
> >        CPPFLAGS='-I/usr/local/include -I/usr/local/include/libpng' \
> >        LDFLAGS=-L/usr/local/lib PKG_CONFIG=`which pkg-config`  \
> >        ./configure --without-ffmpeg --datarootdir=/usr/local/
> >
> > The resulting sox behaves as follows: when OpenBSD's aucat(1)
> > audio server is _not_ running, play(1) works as usual. If aucat(1)
> > _is_ running, play just complains that /dev/audio is busy
> > (which is true, it's used by the running aucat) and exits.
> >
> > That makes me wonder how much is OpenBSD's sndio interface
> > supported in sox. Seeing "sndio: yes" in configure's output
> > makes me think that it is supported; OTOH, one of sndio's
> > great features is that an audio application doesn't need
> > to care whether it is talking to an audio(4) device or
> > an aucat(1) server.
> >
> > sox seems to care: it can play to /dev/audio (if it's not busy),
> > but can't play to aucat. Apparently, this cannot be boiled down
> > down to just calling
> >
> >        sio_open(NULL, mode, 0)
> >
> > in src/sndio.c, as opposed to the current
> >
> >        sio_open(device, mode, 0)
> >
> > (which seems to be relevant, but making this change in the source
> > doesn't change the 'busy' behaviour).
> >
> > I understand there is a sox package/port for OpenBSD
> > which does not have this problem. Anyway, the patches
> > http://www.openbsd.org/cgi-bin/cvsweb/ports/audio/sox/patches/
> > don't seem to deal with this.
> >
> > How hard would it be to make vanilla sox able to play to aucat(1)?
> > That way, I could both
> >
> >        (1) use the newest sox on my machine
> >        (2) continue using the aucat server
> >
> >                Thank you for your time
> >
> >                        Jan
> >
> >
> >
> I've no experience with OpenBSD but can make an educated guess based on like
> you provided.  I guess that OpenBSD must still support OSS and/or SunAU
> audio for backwards compatibility.  For no really good reason that I'm aware
> of, SoX puts sndio driver as a lower choice then oss or sunau.
> 
> You can test if this is true by adding --without-oss --without-sunaudio to
> your configure line.
>
> Or you can force to use sndio driver specifically to
> see if it works better:
> 
> sox infile -t sndio default

When ./configure'd without any device driver specifications,
sox chooses this on OpenBSD 4.6:

OPTIONAL DEVICE DRIVERS
ao (Xiph)..................yes
alsa (Linux)...............no
coreaudio (Mac OS X).......no
sndio (OpenBSD)............yes
oss........................no
pulseaudio.................no
sunaudio...................yes
waveaudio (MS-Windows).....no

The resulting binary can play myaudio files allright,
choosing sunau as the device driver (output edited):

$ play -V file.mp3
play: SoX v14.3.1

Input File     : 'file.mp3'
Output File    : '/dev/audio' (sunau)

So I guess I don't need oss compiled in. If I also disable
sunaudio (./configure --without-oss --without-ao --without-sunaudio),
I can still play my audio files (output edited):

$ play -V file.mp3
play: SoX v14.3.1

Input File     : 'file.mp3'
Output File    : 'default' (sndio)

"sox file.mp3 -t sndio default" works too.

> Please let me know how it goes and I can update source code to prefer sndio
> first when its found compiled in.

Great, thanks.

	Jan

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Jan Stary | 3 Jan 2010 16:34
Picon

Re: 14.3.1.rc2 on OpenBSD - sndio problems

> > I've no experience with OpenBSD but can make an educated guess based on like
> > you provided.  I guess that OpenBSD must still support OSS and/or SunAU
> > audio for backwards compatibility.  For no really good reason that I'm aware
> > of, SoX puts sndio driver as a lower choice then oss or sunau.
> > 
> > You can test if this is true by adding --without-oss --without-sunaudio to
> > your configure line.
> >
> > Or you can force to use sndio driver specifically to
> > see if it works better:
> > 
> > sox infile -t sndio default
> 
> When ./configure'd without any device driver specifications,
> sox chooses this on OpenBSD 4.6:
> 
> 
> OPTIONAL DEVICE DRIVERS
> ao (Xiph)..................yes
> alsa (Linux)...............no
> coreaudio (Mac OS X).......no
> sndio (OpenBSD)............yes
> oss........................no
> pulseaudio.................no
> sunaudio...................yes
> waveaudio (MS-Windows).....no
> 
> 
> The resulting binary can play myaudio files allright,
> choosing sunau as the device driver (output edited):
> 
> $ play -V file.mp3
> play: SoX v14.3.1
> 
> Input File     : 'file.mp3'
> Output File    : '/dev/audio' (sunau)
> 
> So I guess I don't need oss compiled in. If I also disable
> sunaudio (./configure --without-oss --without-ao --without-sunaudio),
> I can still play my audio files (output edited):
> 
> $ play -V file.mp3
> play: SoX v14.3.1
> 
> Input File     : 'file.mp3'
> Output File    : 'default' (sndio)
> 
> "sox file.mp3 -t sndio default" works too.

Relevantly to my original post, when I only leave sndio
as an output device driver, sox makes no difference between talking
to an audio(4) device or a running aucat(1) audio server,
just as a sndio application is supposed to.

NB: I moved to RC3 before writing the above; with RC3,
the above happens on both OpenBSD 4.6 and OpenBSD-current.

	Thanks!

		Jan

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Chris Bagwell | 3 Jan 2010 21:28

Re: 14.3.1.rc2 on OpenBSD - sndio problems



On Sun, Jan 3, 2010 at 9:34 AM, Jan Stary <hans <at> stare.cz> wrote:

>
> So I guess I don't need oss compiled in. If I also disable
> sunaudio (./configure --without-oss --without-ao --without-sunaudio),
> I can still play my audio files (output edited):
>
> $ play -V file.mp3
> play: SoX v14.3.1
>
> Input File     : 'file.mp3'
> Output File    : 'default' (sndio)
>
> "sox file.mp3 -t sndio default" works too.

Relevantly to my original post, when I only leave sndio
as an output device driver, sox makes no difference between talking
to an audio(4) device or a running aucat(1) audio server,
just as a sndio application is supposed to.

OK, I've just updated CVS to prefer sndio driver over sunau driver.  In the next relaese (either RC4 or official release), things should just work as you expect on OpenBSD no matter how you configure it.

Chris
 
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Debasish Chandra | 4 Jan 2010 13:27

Removing silence from a sound file

Hi,

 

I want to remove all the silences more than 1 sec from an audio file, but I couldn’t find any appropriate SOX command for that. Can you please help me to form a command for that?

 

Best Regards,

Debasish

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
msaun76 | 4 Jan 2010 14:45

Re: Re moving silence from a sound file


Hi Debasish, you can use this:

sox in.wav out.wav silence 1 1 0.1% reverse silence 1 1 0.1% reverse

Change in.wav to your input file name, out.wav to your desired output file
name and the 0.1%'s to whichever amplitude threshold you consider as
silence.

Mitch

Debasish Chandra wrote:
> 
> Hi,
> 
> I want to remove all the silences more than 1 sec from an audio file, but
> I couldn't find any appropriate SOX command for that. Can you please help
> me to form a command for that?
> 
> Best Regards,
> Debasish
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Sox-users mailing list
> Sox-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 
> 

--

-- 
View this message in context: http://old.nabble.com/Removing-silence-from-a-sound-file-tp27012898p27013089.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
korekvin | 4 Jan 2010 17:56
Picon
Favicon

Re: Re moving silence from a sound file

Hi, just my curiosity ...
Why do u use reverse?

Z

On 4.1.2010 14:45, msaun76 wrote:
> Hi Debasish, you can use this:
>
> sox in.wav out.wav silence 1 1 0.1% reverse silence 1 1 0.1% reverse
>
> Change in.wav to your input file name, out.wav to your desired output file
> name and the 0.1%'s to whichever amplitude threshold you consider as
> silence.
>
> Mitch
>
>
> Debasish Chandra wrote:
>    
>> Hi,
>>
>> I want to remove all the silences more than 1 sec from an audio file, but
>> I couldn't find any appropriate SOX command for that. Can you please help
>> me to form a command for that?
>>
>> Best Regards,
>> Debasish
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and
>> easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>>
>>      
>    

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
msaun76 | 4 Jan 2010 18:38

Re: Re moving silence from a sound file


Korek is right, the following does the same thing:

sox in.wav out.wav silence 1 1 0.1%

I took this from old code that hadn't been cleaned up correctly.

korek wrote:
> 
> Hi, just my curiosity ...
> Why do u use reverse?
> 
> Z
> 
> On 4.1.2010 14:45, msaun76 wrote:
>> Hi Debasish, you can use this:
>>
>> sox in.wav out.wav silence 1 1 0.1% reverse silence 1 1 0.1% reverse
>>
>> Change in.wav to your input file name, out.wav to your desired output
>> file
>> name and the 0.1%'s to whichever amplitude threshold you consider as
>> silence.
>>
>> Mitch
>>
>>
>> Debasish Chandra wrote:
>>    
>>> Hi,
>>>
>>> I want to remove all the silences more than 1 sec from an audio file,
>>> but
>>> I couldn't find any appropriate SOX command for that. Can you please
>>> help
>>> me to form a command for that?
>>>
>>> Best Regards,
>>> Debasish
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Verizon Developer Community
>>> Take advantage of Verizon's best-in-class app development support
>>> A streamlined, 14 day to market process makes app distribution fast and
>>> easy
>>> Join now and get one step closer to millions of Verizon customers
>>> http://p.sf.net/sfu/verizon-dev2dev
>>> _______________________________________________
>>> Sox-users mailing list
>>> Sox-users <at> lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>>
>>>
>>>      
>>    
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Sox-users mailing list
> Sox-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 
> 

--

-- 
View this message in context: http://old.nabble.com/Removing-silence-from-a-sound-file-tp27012898p27016335.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
msaun76 | 4 Jan 2010 19:59

Re: libsox compand


Since my first post was New Year's eve, most of the people who would have
answered were understandably busy with far more important things!

So I'm throwing a last call for help on this issue, if anyone knows how I
could pass arguments to compand through libsox, it would be greatly
appreciated.

Cheers,
Mitch

msaun76 wrote:
> 
> I'm using libsox in software I'm writing but I'm having trouble with the
> compand effect parameters.
> 
> I believe the comma in the parameters is confusing the parser.  Here's an
> excerpt from an example file in the sox source:
> 
> /* Create the `vol' effect, and initialise it with the desired parameters:
> */
> e = sox_create_effect(sox_find_effect("vol"));
> args[0] = "3dB", assert(sox_effect_options(e, 1, args) == SOX_SUCCESS);
> /* Add the effect to the end of the effects processing chain: */
> assert(sox_add_effect(chain, e, &in->signal, &in->signal) == SOX_SUCCESS);
> 
> I want to process the buffer like this: compand 0,.1 -12,0 -0.1 0 0
> What is wrong with this argument line?
> args[0] = "0,.1", args[1] = "-12,0", args[2] = "-0.1", args[3] = "0",
> args[4] = "0", assert(sox_effect_options(e, 5, args) == SOX_SUCCESS);
> 
> I tried isolating the comma separated values into their own arguments but
> to no avail.
> 
> Thanks!
> 

--

-- 
View this message in context: http://old.nabble.com/libsox-compand-tp26979890p27017636.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Jan Stary | 4 Jan 2010 20:29
Picon

Re: libsox compand

On Jan 04 10:59:27, msaun76 wrote:
> So I'm throwing a last call for help on this issue, if anyone knows how I
> could pass arguments to compand through libsox, it would be greatly
> appreciated.

The manpage of libsox knows. Have you read it?
Or did you miss the sox_effect_options() function?

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

Gmane