Truncating silence in the middle of a file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Truncating silence in the middle of a file

Shawn Dowler
I've been playing around with the silence effect.  I would like to
find a way to have an input file with sporatic periods of silence
between 2 and 5 minutes long and output to a file that truncates each
of these pauses to ~2 seconds in length.

Again: I want to replace all pauses longer than 2 seconds with pauses
that are only 2 seconds long.

Any help with this would be greatly appreciated.  I have searched and
searched and could not find any examples that got me anywhere close to
what I'm describing here.

Thanks for any help you might be able to lend,
Shawn Dowler

--
http://walkingtowel.org


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Truncating silence in the middle of a file

Shawn Dowler
I know it's bad form to reply to one's own question, but I may have
solved it myself.  Firstly, it appears that the functionality that I
was looking for either did not exist by design, or was somehow
implemented wrong in version 12.17.8.  When I compiled version 12.17.9
and tested some of what I thought should have worked based on the man
page it did AMAZING things!  Here is the command I used:

sox ./test_hard.wav ./test_silence2.wav silence 1 -0.9 2% -2 -0.9 2%

As far as I can tell, this does exactly what I want.  I generated
silence at the beginning and end of the test file I had, and I put
some silence in the middle, too.  Then I ran this command, and no long
pauses.  It's GREAT!  As far as I can tell I can have this parse any
file with any arbitrary number of pauses and the results are that all
pauses are eliminated.

I have to do some more tests with this, but I am very impressed.

Shawn Dowler

On 2/28/06, Shawn Dowler <[hidden email]> wrote:

> I've been playing around with the silence effect.  I would like to
> find a way to have an input file with sporatic periods of silence
> between 2 and 5 minutes long and output to a file that truncates each
> of these pauses to ~2 seconds in length.
>
> Again: I want to replace all pauses longer than 2 seconds with pauses
> that are only 2 seconds long.
>
> Any help with this would be greatly appreciated.  I have searched and
> searched and could not find any examples that got me anywhere close to
> what I'm describing here.
>
> Thanks for any help you might be able to lend,
> Shawn Dowler
>
> --
> http://walkingtowel.org
>


--
http://walkingtowel.org


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: Truncating silence in the middle of a file

Chris Bagwell
Nice to hear a positve comment on the silence effect for change!  It
gets a bad wrap on the mailing list usually.

Thanks,
Chris

Shawn Dowler wrote:

>sox ./test_hard.wav ./test_silence2.wav silence 1 -0.9 2% -2 -0.9 2%
>
>As far as I can tell, this does exactly what I want.  I generated
>silence at the beginning and end of the test file I had, and I put
>some silence in the middle, too.  Then I ran this command, and no long
>pauses.  It's GREAT!  As far as I can tell I can have this parse any
>file with any arbitrary number of pauses and the results are that all
>pauses are eliminated.
>
>  
>
>  
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Truncating silence in the middle of a file

Shawn Dowler
All right!  I have done extensive tests on my source material
(recorded talk-radio from internet streams) and I have found settings
that make it so one cannot even tell there were any gaps, plus it
removed "dead air" when the speaker pauses excessively or is waitng
for a caller to respond, thus allowing one to fit more "content" on
one audio CD (or in a shorter period of time)

Anyway, here are those settings if anyone wants them for anything like this:

sox input.wav output.wav silence 1 0.2 0.5% -1 0.2 0.5%

Everything seems to be working as expected.  Thanks for all the direct
interaction and work on this issue.  SoX RoX!

Shawn Dolwer

On 3/5/06, Shawn Dowler <[hidden email]> wrote:

> Thanks for responding so quickly.  I will recompile with the updated
> file.  I'm using Slackware 10.2 and the package they have is one
> release behind anyway, so I had to compile it myself... not a problem.
>  I will report my findings with other files.
>
> Shawn Dowler
>
> On 3/5/06, Chris Bagwell <[hidden email]> wrote:
> > OK, I fixed several bugs in the silence effect and I was able to remove
> > all silence from the sound file you sent.  I was able to do it with the
> > following command line:
> >
> > sox gaps.ogg test.wav silence 1 0.5 1% -1 0.5 1%
> >
> > I've attached a copy of the fixed silence.c file.  If you can recompile
> > your version of sox then you can replace src/silence.c with this file.
> > If not, I hope to be releasing a new version of sox within a month or so.
> >
> > Chris
> >
> > Shawn Dowler wrote:
> >
> > >Here is the command line:
> > >
> > >sox ./gaps.wav -c 1 gaps_removed.wav silence 1 -0.5 1% -1 -0.5 1%
> > >
> > >Now if I use this command line the third gap doesn't have the problem.
> > >
> > >sox ./gaps.wav -c 1 sox19.wav silence 1 -00:00:01 1% -1 00:00:00 1%
> > >
> > >On 3/5/06, Chris Bagwell <[hidden email]> wrote:
> > >
> > >
> > >>Do you have a sample file you can send me were you can hear this problem
> > >>easily?  Also, please send the command line your using with it.
> > >>
> > >>Its much easier/faster for me to debug these problems by listening then
> > >>to load it up in a visual editor.
> > >>
> > >>Off hand, it sounds like we are letting one buffer of trash audio
> > >>threw.  SoX's internal buffers are round 8k so 1 buffer of trash
> > >>wouldn't normally be heard when your working with 41k sample rates.
> > >>
> > >>Thanks,
> > >>Chris
> > >>
> > >>Shawn Dowler wrote:
> > >>
> > >>
> > >>
> > >>>Well, the honeymoon couldn't last forever, now... could it?
> > >>>
> > >>>I have run into a relatively serious problem.  Well, it's not a
> > >>>showstopper, but it's not very good.  Using the -1 switch for the
> > >>>below period makes the silent parts disappear, but in that moment
> > >>>where it hits the sound again, there is a strange skipping behavior
> > >>>that I can't find a way to get rid of.  Here is a visual
> > >>>representation.
> > >>>
> > >>>First, the original would look like this, with a big silent gap:
> > >>>
> > >>>|||||--------------------------------------------------------|||||
> > >>>
> > >>>What I would expect is something like the following to be the result
> > >>>of using silence to remove silence from the middle of files:
> > >>>
> > >>>|||||-|||||
> > >>>
> > >>>But what I always get is:
> > >>>
> > >>>|||||-|-|||||
> > >>>
> > >>>The samples in the center of the silence are repeats of the end of the
> > >>>preceding sample.
> > >>>
> > >>>Another way to represent it visually - each letter represents a unique
> > >>>chunk of sound, dashes represent silence:
> > >>>
> > >>>abcde-e-fghij
> > >>>
> > >>>The chunk of sound labeled "e" gets repeated with silence surrounding
> > >>>it.  I don't know what would cause this behaviour, but is sounds
> > >>>pretty bad.  Everything is SOOO close!
> > >>>
> > >>>Again, thanks for any help or suggestions that might be offered.  And
> > >>>thanks for the work being done to constantly improve SoX!
> > >>>
> > >>>Shawn Dowler
> > >>>--
> > >>>http://walkingtowel.org
> > >>>On 3/3/06, Shawn Dowler <[hidden email]> wrote:
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>>I think the main reason that it gets bagged on so much is that its
> > >>>>syntax is confusing.  Trial and error got me the results I wanted. I
> > >>>>couldn't figure out what to do exactly so I made a test file with a
> > >>>>bunch of silent gaps and started playing with the values until I got
> > >>>>what I wanted.
> > >>>>
> > >>>>BTW, it turns out that I get better results (less clipping) if I
> > >>>>replace the 2% threshhold with 1%, like so:
> > >>>>
> > >>>>sox ./foo_with_gaps.wav ./bar_without_gaps.wav silence 1 -0.9 1% -2 -0.9 1%
> > >>>>
> > >>>>Works a treat!  Thanks again for all your work on this project!
> > >>>>
> > >>>>Shawn Dowler
> > >>>>
> > >>>>On 3/2/06, Chris Bagwell <[hidden email]> wrote:
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>>Nice to hear a positve comment on the silence effect for change!  It
> > >>>>>gets a bad wrap on the mailing list usually.
> > >>>>>
> > >>>>>Thanks,
> > >>>>>Chris
> > >>>>>
> > >>>>>Shawn Dowler wrote:
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>sox ./test_hard.wav ./test_silence2.wav silence 1 -0.9 2% -2 -0.9 2%
> > >>>>>>
> > >>>>>>As far as I can tell, this does exactly what I want.  I generated
> > >>>>>>silence at the beginning and end of the test file I had, and I put
> > >>>>>>some silence in the middle, too.  Then I ran this command, and no long
> > >>>>>>pauses.  It's GREAT!  As far as I can tell I can have this parse any
> > >>>>>>file with any arbitrary number of pauses and the results are that all
> > >>>>>>pauses are eliminated.
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>
> > >>>>>
> > >>>>--
> > >>>>http://walkingtowel.org
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>
> > >>
> > >
> > >
> > >--
> > >http://walkingtowel.org
> > >
> >
> >
> >
> >
>
>
> --
> http://walkingtowel.org
>


--
http://walkingtowel.org


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: Truncating silence in the middle of a file

Chris Bagwell
Hi all,

There were some pretty big bugs in the "restart" feature of the silence
effect (when you use a negative value for the periods).  I've just now
commited those fixes to CVS and so all can grab it that needs it.

Also, the effect uses some RMS values on audio data to try and debounce
single sample periods of silence.  Previously, it was using a window
size of 1/10 a second which was quite noticable on playback; especially
when using the "restart" feature.  Thats because you'll generally have
an RMS window size amount of silence left at the end of your file if it
doesn't fade out and let the RMS decay on its own.  I changed the RMS
window to 1/50 which is pretty hard to hear that amount of silence.

Chris

Shawn Dowler wrote:

>All right!  I have done extensive tests on my source material
>(recorded talk-radio from internet streams) and I have found settings
>that make it so one cannot even tell there were any gaps, plus it
>removed "dead air" when the speaker pauses excessively or is waitng
>for a caller to respond, thus allowing one to fit more "content" on
>one audio CD (or in a shorter period of time)
>
>Anyway, here are those settings if anyone wants them for anything like this:
>
>sox input.wav output.wav silence 1 0.2 0.5% -1 0.2 0.5%
>
>Everything seems to be working as expected.  Thanks for all the direct
>interaction and work on this issue.  SoX RoX!
>
>Shawn Dolwer
>  
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Windows build of latest .EXE

Mal-3
In reply to this post by Shawn Dowler
Hi all,

Would any of you have a Windows build of the latest .EXE ( which
includes the fix for the SOX noisered limiting assert bug ).

Also, the list of supported OS's doesn't seem to include OS/X, which I
though was a bit odd as most sound studios I know seem to still be Mac
based.  Is there an OS/X build available?

Many thanks in advance!
Mal


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users