I've never used SoX's "compand" effect myself but, looking at your code examples above, I'd suggest you ignore the -G and -v options and instead increase the compand attenuation itself until SoX no longer reports clipping: you've set it at -4 at the moment; try something like -12 instead to see if that reduces the number of clipped samples.
You may also want to Google "sox compand effect clipping" (including the quotation marks); it brings up a fair number of results, e.g. the first reply in this 1-page thread or the first five posts in this similarly short thread.
Incidentally, last year, when someone on Audio Science Review claimed that SoX was no longer being updated, one of its contributors, Mans Rullgard, who I gather is also among the top contributors to FFmpeg, had this to say: "Is there some bug you're hoping to get fixed, or are you just addicted to updates?" He has a wonderful way with words, and I'm sure he'd be happy to sort you out.
Announcement
Collapse
No announcement yet.
Any automated way to tell of an MP3 track is compressed
Collapse
X
-
Yeah, I ran a small selection of files with various -v from .98 down to .90 and had very little impact on the number of WARN messages.
And the --norm and -G are supposed to fix it as well.
The sox script finished after about 24 hours. Maybe a bit more.
Leave a comment:
-
Edit: come to think of it, shouldn't a compressor always REDUCE peak levels prior to applying makeup gain? In which case why would it ever create clipping?Last edited by cliveb; 2023-03-04, 23:39.👍 1Leave a comment:
-
I have a script running sox to apply the "compand" process. Its been running for about 24 hours. I have no way to know how far its along. I guess it might be half done.
The script looks like
sox -V2 -v 0.98 --norm -G "/home/.../mp3/.../Angel of the South.mp3" "/home/.../mp6/.../Angel of the South.mp3" compand 0.3,1 6:-70,-60,-20 -4 -90 0.2
sox -V2 -v 0.98 --norm -G "/home/.../mp3/.../Big Sky Country (Nashville version).mp3" "/home/.../mp6/.../Big Sky Country (Nashville version).mp3" compand 0.3,1 6:-70,-60,-20 -4 -90 0.2
sox -V2 -v 0.98 --norm -G "/home/.../mp3/...Big Sky Country.mp3" "/home/.../mp6/.../Big Sky Country.mp3" compand 0.3,1 6:-70,-60,-20 -4 -90 0.2
I tried adjusting the prameter, and added three paramters that were suggested would lower the number
-v 0.98 is supposed to lower all of the volume/gain by 98%
--norm turns on normalization
--G turns on automatic gain respect.
In theory, each of these will stop the warnings, but so far, not reallyLeave a comment:
-
Back to your original question, best way I know to batch-check dynamic range is the foobar "Dynamic Range Meter" plugin: https://wiki.hydrogenaud.io/index.ph..._dynamic_range)Leave a comment:
-
BTW, I'm using the Apache license on the tools I'm writing, and its all up on github
Leave a comment:
-
I can't help you with detecting pre-existing compression, but have one other comment.
Rather than dynamic range compression, you could perhaps consider some form of gain riding instead.
Foobar2000 has a DSP component called VLevel that will do this for you, and it's what I use when preparing music for use in the car.
As you have probably discovered, FB2K can batch process your whole collection in one pass, and all you need to do to invoke compression and/or gain riding is to activate the DSP component(s) during the conversion stage.Leave a comment:
-
SoX's "compand" effect might work; the documentation even gives an example that matches your use case: "The following example might be used to make a piece of music with both quiet and loud passages suitable for listening to in a noisy environment such as a moving vehicle..."
sox --version
sox: SoX v14.4.2
the example command looks like:
sox asz.wav asz-car.wav compand 0.3,1 6:−70,−60,−20 −5 −90 0.2
Unicode Character “−” (U+2212) is bad
ASCII - (2D) is good.
I've got the basics working, but I need to tweak my parameters. sox doesn't seem to like having the resulting values go past full scale.Leave a comment:
-
It looks like sox or maybe even ffmpeg can do the dynamic range compression, if not detecting if its been done once (or twice) already to the songs.
Leave a comment:
-
https://manual.audacityteam.org/man/scripting.html ...which like you I want to compress for 'listening' in a VW T5 5cylinder van a challenge probably require a DR of about 6 !
I manually used Audacity to compress the MP3s a few years ago, but I had a lot fewer songs to process.
Leave a comment:
-
SoX's "compand" effect might work; the documentation even gives an example that matches your use case: "The following example might be used to make a piece of music with both quiet and loud passages suitable for listening to in a noisy environment such as a moving vehicle..."
It won't detect previously compressed files, though.
Leave a comment:
-
SoX's "compand" effect might work; the documentation even gives an example that matches your use case: "The following example might be used to make a piece of music with both quiet and loud passages suitable for listening to in a noisy environment such as a moving vehicle..."
If you like what it does to a single file, or a few representative samples, you could then use something likeCode:find -name "*.flac" -exec [your SoX command goes here] {} \;
It won't detect previously compressed files, though.Last edited by MainSqueeze; 2023-03-02, 20:57.👍 1Leave a comment:
-
While I'm re-ripping to flac, for the thumbdrive in my car for road trips, I need to have run the tunes thru an audio compressor. Not compressed like MP3 to save space, but an audio compressor to reduce the dynamic range. The car has so much wind noise, tire noise, engine noise, etc. that the full 96dB of dynamic range of a CD or flac file is not useful.
When I was selecting single songs, I could just run the song thru Audacity. But now I have to process 3164 songs, and the count is growing.
I want to automate the compression, but I'd like a way to tell if the song has already been thru the audio compression. I'd rather not double compress them.
Any idea of tools?Leave a comment:
-
https://manual.audacityteam.org/man/scripting.html any use?
another which I must read thoroughly: https://medium.com/@jud.dagnall/dyna...d-621fe2b1a892
Auto detect dynamic range I haven't looked at at as my library is all flac which like you I want to compress for 'listening' in a VW T5 5cylinder van a chalange probably require a DR of about 6 !
bonne chance StreborLast edited by strebor56; 2023-03-01, 12:30.👍 1Leave a comment:
-
Leave a comment: