Empty result file when removing silence

View: New views
7 Messages — Rating Filter:   Alert me  

Empty result file when removing silence

by Fredrik Sandedal :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I have tried to remove silence in the end of audio files. But the result is always an empty audio file.

Could someone please advise what I might be doing wrong? It works fine with PCM wav file but not A-Law.

 

See below for syntax and debug info.

 

Kind regards,

Fredrik

 

sox 1.wav 1_.wav silence 0 1 0.4 1%

 

sox formats: detected file format type `wav'

sox wav: WAV Chunk fmt

sox wav: WAV Chunk fact

sox wav: WAV Chunk data

sox wav: Reading Wave file: Microsoft A-law format, 1 channel, 8000 samp/sec

sox wav:         8000 byte/sec, 1 block align, 8 bits/samp, 27360 data bytes

sox wav:         27360 Samps/chans

 

Input File     : '1.wav'

Channels       : 1

Sample Rate    : 8000

Precision      : 13-bit

Duration       : 00:00:03.42 = 27360 samples ~ 256.5 CDDA sectors

Sample Encoding: 8-bit A-law

Endian Type    : little

Reverse Nibbles: no

Reverse Bits   : no

 

sox sox: Overwriting `1_.wav'

sox wav: Writing Wave file: Microsoft A-law format, 1 channel, 8000 samp/sec

sox wav:         8000 byte/sec, 1 block align, 8 bits/samp

 

Output File    : '1_.wav'

Channels       : 1

Sample Rate    : 8000

Precision      : 13-bit

Duration       : 00:00:03.42 = 27360 samples ~ 256.5 CDDA sectors

Sample Encoding: 8-bit A-law

Endian Type    : little

Reverse Nibbles: no

Reverse Bits   : no

Comment        : 'Processed by SoX'

 

sox sox: effects chain: input      8000Hz 1 channels 13 bits (multi)

sox sox: effects chain: silence    8000Hz 1 channels 13 bits (multi)

sox sox: effects chain: output     8000Hz 1 channels 13 bits (multi)

sox wav: Finished writing Wave file, 0 data bytes 0 samples

 

/Fredrik

 


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Re: Empty result file when removing silence

by Chris Bagwell :: Rate this Message:

| View Threaded | Show Only this Message



On Fri, May 8, 2009 at 7:42 AM, Fredrik Sandedal <fredrik.sandedal@...> wrote:

Hi,

 

I have tried to remove silence in the end of audio files. But the result is always an empty audio file.

Could someone please advise what I might be doing wrong? It works fine with PCM wav file but not A-Law.

 

See below for syntax and debug info.

 

Kind regards,

Fredrik

 

sox 1.wav 1_.wav silence 0 1 0.4 1%

 


This line says "0" = do not trim silence from front. "1 0.4 1%" = stop when silence is detected and that amount is only 0.4 seconds worth of silence.

It is very easy to have pauses of silence that short... especially since small amount of silence at front of audio is very common.

You will have better luck trimming silence off the end with following:

sox 1.wav 1_.wav reverse silence 1 0.4 1% reverse

Chris


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Parent Message unknown Re: Empty result file when removing silence

by Fredrik Sandedal :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Thanks for the advice.

 

It doesn’t matter if I reserve the audio file. The result is still an empty audio file.

And it is still working with a 16bit 8 kHz PCM wav file but not with 8bit 8 kHz A-Law wav file.

 

I could resample the a-law file to PCM, remove silence and then resample back to a-law but it doesn’t seem to be very efficient.

 

Any ideas for a better solution? Could this be a bug in Sox, that there is a problem with removing silence from a-law encoded audio files?

 

Regards,

 

/Fredrik


On Fri, May 8, 2009 at 7:42 AM, Fredrik Sandedal
<fredrik.sandedal@en...>wrote:

> Hi,
>
>
>
> I have tried to remove silence in the end of audio files. But the result is
> always an empty audio file.
>
> Could someone please advise what I might be doing wrong? It works fine with
> PCM wav file but not A-Law.
>
>
>
> See below for syntax and debug info.
>
>
>
> Kind regards,
>
> Fredrik
>
>
>
> sox 1.wav 1_.wav silence 0 1 0.4 1%
>
>
>

This line says "0" = do not trim silence from front. "1 0.4 1%" = stop when
silence is detected and that amount is only 0.4 seconds worth of silence.

It is very easy to have pauses of silence that short... especially since
small amount of silence at front of audio is very common.

You will have better luck trimming silence off the end with following:

sox 1.wav 1_.wav reverse silence 1 0.4 1% reverse

Chris

 

 

 

From: Fredrik Sandedal
Sent: Friday, May 08, 2009 2:42 PM
To: 'sox-users@...'
Subject: Empty result file when removing silence

 

Hi,

 

I have tried to remove silence in the end of audio files. But the result is always an empty audio file.

Could someone please advise what I might be doing wrong? It works fine with PCM wav file but not A-Law.

 

See below for syntax and debug info.

 

Kind regards,

Fredrik

 

sox 1.wav 1_.wav silence 0 1 0.4 1%

 

sox formats: detected file format type `wav'

sox wav: WAV Chunk fmt

sox wav: WAV Chunk fact

sox wav: WAV Chunk data

sox wav: Reading Wave file: Microsoft A-law format, 1 channel, 8000 samp/sec

sox wav:         8000 byte/sec, 1 block align, 8 bits/samp, 27360 data bytes

sox wav:         27360 Samps/chans

 

Input File     : '1.wav'

Channels       : 1

Sample Rate    : 8000

Precision      : 13-bit

Duration       : 00:00:03.42 = 27360 samples ~ 256.5 CDDA sectors

Sample Encoding: 8-bit A-law

Endian Type    : little

Reverse Nibbles: no

Reverse Bits   : no

 

sox sox: Overwriting `1_.wav'

sox wav: Writing Wave file: Microsoft A-law format, 1 channel, 8000 samp/sec

sox wav:         8000 byte/sec, 1 block align, 8 bits/samp

 

Output File    : '1_.wav'

Channels       : 1

Sample Rate    : 8000

Precision      : 13-bit

Duration       : 00:00:03.42 = 27360 samples ~ 256.5 CDDA sectors

Sample Encoding: 8-bit A-law

Endian Type    : little

Reverse Nibbles: no

Reverse Bits   : no

Comment        : 'Processed by SoX'

 

sox sox: effects chain: input      8000Hz 1 channels 13 bits (multi)

sox sox: effects chain: silence    8000Hz 1 channels 13 bits (multi)

sox sox: effects chain: output     8000Hz 1 channels 13 bits (multi)

sox wav: Finished writing Wave file, 0 data bytes 0 samples

 

/Fredrik

 


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Parent Message unknown Re: Empty result file when removing silence

by robs-5 :: Rate this Message:

| View Threaded | Show Only this Message


--- On Tue, 12/5/09, Fredrik Sandedal <fredrik.sandedal@...> wrote:
> And it is
> still working with a 16bit 8 kHz
> PCM wav file but not with 8bit 8 kHz A-Law wav
> file.
>
> Could
> this be a bug in Sox, that there is a problem with removing
> silence from a-law encoded
> audio files?

Quite likely: I've had a look at the code and it seems only 8,16,24,32 bit are supported.  So for now, converting to linear PCM, removing silence, then converting back would seem to be the best option.  Note that these conversions are lossless.

HTH,
Rob


     

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Re: Empty result file when removing silence

by Fredrik Sandedal :: Rate this Message:

| View Threaded | Show Only this Message

Thanks Rob,

I'm able to get the source file in 16bit PCM so I'll do it that way for
now.

Regards,
/Fredrik

-----Original Message-----
From: robs [mailto:aquegg@...]
Sent: Monday, May 18, 2009 9:21 AM
To: sox-users@...
Subject: Re: [SoX-users] Empty result file when removing silence


--- On Tue, 12/5/09, Fredrik Sandedal <fredrik.sandedal@...> wrote:
> And it is
> still working with a 16bit 8 kHz
> PCM wav file but not with 8bit 8 kHz A-Law wav
> file.
>
> Could
> this be a bug in Sox, that there is a problem with removing
> silence from a-law encoded
> audio files?

Quite likely: I've had a look at the code and it seems only 8,16,24,32
bit are supported.  So for now, converting to linear PCM, removing
silence, then converting back would seem to be the best option.  Note
that these conversions are lossless.

HTH,
Rob


     

------------------------------------------------------------------------
------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Parent Message unknown Re: Empty result file when removing silence

by robs-5 :: Rate this Message:

| View Threaded | Show Only this Message


--- On Tue, 19/5/09, Fredrik Sandedal <fredrik.sandedal@...> wrote:

> I'm able to get the source file in 16bit PCM so I'll do it
> that way for
> now.
>
> > And it is
> > still working with a 16bit 8 kHz
> > PCM wav file but not with 8bit 8 kHz A-Law wav
> > file.

FYI, a fix has now been put in place for the next release.

Cheers,
Rob




     

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

Re: Empty result file when removing silence

by Fredrik Sandedal :: Rate this Message:

| View Threaded | Show Only this Message

Many thanks...

Kind regards,
Fredrik

-----Original Message-----
From: robs [mailto:aquegg@...]
Sent: Monday, May 25, 2009 8:02 PM
To: sox users list
Subject: Re: [SoX-users] Empty result file when removing silence


--- On Tue, 19/5/09, Fredrik Sandedal <fredrik.sandedal@...> wrote:

> I'm able to get the source file in 16bit PCM so I'll do it
> that way for
> now.
>
> > And it is
> > still working with a 16bit 8 kHz
> > PCM wav file but not with 8bit 8 kHz A-Law wav
> > file.

FYI, a fix has now been put in place for the next release.

Cheers,
Rob




     

------------------------------------------------------------------------
------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals.
Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like
Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Sox-users mailing list
Sox-users@...
https://lists.sourceforge.net/lists/listinfo/sox-users