*SOLVED* Audio LEVELER not NORMALISER

Discussion of software apps
JimW
Posts: 25
Joined: Tue Jan 16, 2018 8:12 pm

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by JimW »

Isn't that the purpose of computers and this site? :shock:

To have fun and learn - and learn while having fun! :lol:
I did learn a thing or two today, thanks to Dai - and had fun doing it!
User avatar
crosscourt
Posts: 11138
Joined: Sun Jan 14, 2018 5:38 pm
Location: Wash DC
Contact:

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by crosscourt »

Hes a font of knowledge, lets hope that rubs off on me a bit. Ive been helping one of our members do a distro install on his older computer that went well. :)
Site Moderator
User avatar
dai_trying
Posts: 706
Joined: Sun Jan 14, 2018 7:44 pm
Location: UK
Contact:

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by dai_trying »

@Jim
The line newgain=`echo "${mygain//[!0-9.]/}"` simply cleans the output of the $gain variable, it had a minus sign and some white-space which would mess up the next command, basically it will only leave numbers and full-stops (periods) so it can be used for the gain in ffmpeg.

And I also learn a bit along the way, as a for instance I have never needed to normalize the sound in a file, but I have some that are too quite in places and now I have the solution at my fingertips. :)
chris
Posts: 112
Joined: Mon Jan 15, 2018 11:37 pm
Location: UK

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by chris »

You don't need the `` expression, just newgain=${mygain//[!0-9.]}
HIH
User avatar
dai_trying
Posts: 706
Joined: Sun Jan 14, 2018 7:44 pm
Location: UK
Contact:

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by dai_trying »

You're right, I just cut/pasted from an old script and did notice it after it was posted and probably should have edited it... Thanks for spotting it though. :)
JimW
Posts: 25
Joined: Tue Jan 16, 2018 8:12 pm

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by JimW »

I just tried your script out on a four minute mp4 - it works!

Something I have noticed. If there is a spike (click/pop/etc) that goes to 0db then the resulting volume is based from that and comes out lower than you might expect. When that happens I just load it into Audacity and remove the spike then amplify.
User avatar
dai_trying
Posts: 706
Joined: Sun Jan 14, 2018 7:44 pm
Location: UK
Contact:

Re: *SOLVED* Audio LEVELER not NORMALISER

Post by dai_trying »

I did notice that on the test file, although it wasn't a very big difference so thought it might be ok. I guess if you are going to set it up to run automatically you are only likely to notice if the file is particularly quiet when playing it back.
Post Reply