Announcement

Collapse
No announcement yet.

Any automated way to tell of an MP3 track is compressed

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Any automated way to tell of an MP3 track is compressed

    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?

    Pat
    http://www.pfarrell.com/music/slimse...msoftware.html

  • #2
    Originally posted by pfarrell
    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.
    ....
    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?
    I don't know a tool that can do that, but just want to make the remark that many (modern and rock music) albums do not make use of the 96dB dynamic range of the CD or flac file at all, and are already heavily compressed during the mixing and mastering of these albums. See Loudness war - Wikipedia
    So if you are looking for an automated compression solution, that solution should preferably analyse the dynamic range being used by the tracks c.q. album that you want to compress, and then only do the compression if the dynamic range exceeds a certain value. I hope my remark makes sense.
    Last edited by CJS; 2023-02-28, 13:06.
    | LMS 8.3.2 on Linux Mint 21.2 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

    Comment


    • #3
      I doubt there is a way to detect the previously-compressed files, but you can easily re-run the original batch of FLACs through foobar2000 using the compressor component:

      Hopefully, the default settings do what you want as I have no idea how to adjust it!

      Comment


      • #4
        Originally posted by CJS
        I don't know a tool that can do that, but just want to make the remark that many (modern and rock music) albums do not make use of the 96dB dynamic range ..... See Loudness war - Wikipedia
        For sure, the loudness wars were in full roar when I did my first ripping and tagging for my Squeezeserver.

        While a solid percentage of my CDs are "greatest hits" which have a high probability of being remastered and ruined in the 2000s, the older ones predated that mess.

        Sadly, for use in my crossover, even a 40db dymanic range is probably too much.
        Pat
        http://www.pfarrell.com/music/slimse...msoftware.html

        Comment


        • #5
          Originally posted by Apesbrain
          I doubt there is a way to detect the previously-compressed files, but you can easily re-run the original batch of FLACs through foobar2000 using the compressor component: Hopefully, the default settings do what you want as I have no idea how to adjust it!
          well, I have installed foobar2000 and the compressor "component" but
          most of the links to documentation on the official foobar2000.org page are dead or nearly empty.
          So I have no idea how I could even apply the component to a single song, let alone a folder full of songs.
          Or how I could adjust the usual knee, steepness, etc. knobs on the compressor.

          There does seem to be an active forum on hydrogenaudio about foobar....

          I have (well had) a bunch of VST effects back when I had a recording studio in my basement. I wonder if they were on floppies or on CDs. Its been so long, I'm not even sure where to look for them.

          I'm thinking maybe I should write some code to stream files in thru VST with a plug-in design.... not sure how to find out how to begin that.
          Pat
          http://www.pfarrell.com/music/slimse...msoftware.html

          Comment


          • #6
            Originally posted by pfarrell
            I'm thinking maybe I should write some code to stream files in thru VST with a plug-in design....

            Comment


            • #7
              Originally posted by pfarrell
              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.
              Sadly no. Though storage is cheap.
              The little mini SanDisk 128GB (Ultra Fit) is just $14.69 on Amazon right now.
              Bob Harper

              Comment


              • #8
                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 Strebor
                Last edited by strebor56; 2023-03-01, 12:30.

                Comment


                • #9
                  Originally posted by pfarrell
                  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?
                  The mastering engineers have ready done the compression for you on most modern CDs 🤣
                  Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
                  Bedroom: Radio
                  Bathroom: Radio

                  Comment


                  • #10
                    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 like
                    Code:
                    find -name "*.flac" -exec [your SoX command goes here] {} \;
                    and point it at the folder that holds the files to be companded; on a modern machine SoX will go thru 3,000 files in a few minutes.

                    It won't detect previously compressed files, though.
                    Last edited by MainSqueeze; 2023-03-02, 20:57.

                    Comment


                    • #11
                      Originally posted by MainSqueeze
                      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.
                      thanks, that is exactly my use case.
                      Pat
                      http://www.pfarrell.com/music/slimse...msoftware.html

                      Comment


                      • #12
                        Originally posted by strebor56
                        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 !
                        Great link, thanks. My Mazda CX5 is a nice crossover, but the background noise may approach your VW van, especially when I'm towing an open trailer full of dirt bikes. Back in 97, I had a Lincoln LSC, that was quiet enough that you could hear the squeaks of a thumb on the back of the neck of an acoustic guitar. My VW Passat was decent, but not as quiet as the Lincoln.

                        I manually used Audacity to compress the MP3s a few years ago, but I had a lot fewer songs to process.
                        Pat
                        http://www.pfarrell.com/music/slimse...msoftware.html

                        Comment


                        • #13
                          Originally posted by bobharp
                          Though storage is cheap. The little mini SanDisk 128GB (Ultra Fit) is just $14.69 on Amazon right now.
                          Thanks, but you are completely missing what I am looking for. I don't care about the size of the music files, as you say, storage is cheap. I do not want the compression you get going from FLAC to MP3. I want audio compression as an effect to reduce the dynamic range of the music. Its easy to do with Audacity, one song at a time.

                          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.
                          Pat
                          http://www.pfarrell.com/music/slimse...msoftware.html

                          Comment


                          • #14
                            Originally posted by MainSqueeze
                            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..."
                            The sox website example shows a command that will not work with the current sox version
                            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
                            which is apparently a unicode minus sign, and the current sox version expects an ASCII minus sign.
                            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.
                            Pat
                            http://www.pfarrell.com/music/slimse...msoftware.html

                            Comment


                            • #15
                              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.
                              Until recently: Transporter -> ATC SCM100A, now sold :-(
                              House move forced change to: piCorePlayer(RPi2/HiFiBerry DIGI2 Pro) -> Meridian 218 -> Meridian M6

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎