Isn't that the purpose of computers and this site?
To have fun and learn - and learn while having fun!
I did learn a thing or two today, thanks to Dai - and had fun doing it!
*SOLVED* Audio LEVELER not NORMALISER
-
- Posts: 11176
- Joined: Sun Jan 14, 2018 5:38 pm
Re: *SOLVED* Audio LEVELER not NORMALISER
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.
- dai_trying
- Posts: 634
- Joined: Sun Jan 14, 2018 7:44 pm
- Location: UK
- Contact:
Re: *SOLVED* Audio LEVELER not NORMALISER
@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.
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.
Re: *SOLVED* Audio LEVELER not NORMALISER
You don't need the `` expression, just newgain=${mygain//[!0-9.]}
HIH
HIH
- dai_trying
- Posts: 634
- Joined: Sun Jan 14, 2018 7:44 pm
- Location: UK
- Contact:
Re: *SOLVED* Audio LEVELER not NORMALISER
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.
Re: *SOLVED* Audio LEVELER not NORMALISER
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.
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.
- dai_trying
- Posts: 634
- Joined: Sun Jan 14, 2018 7:44 pm
- Location: UK
- Contact:
Re: *SOLVED* Audio LEVELER not NORMALISER
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.