Harmony Central Forums
Announcement
Collapse
No announcement yet.

How much does a clip of digital audio "weigh" in filesize?

Collapse
X
  • Time
  • Show
Clear All
new posts

  • How much does a clip of digital audio "weigh" in filesize?

    I've been uploading seamless loops of digital audio to an online website, and I've observed something interesting: If you take three WAV audio clips, each one recorded in 44100/16-bit, each one lasting 4 measures long, recorded in at 90BPM.... you'll find that each turns out to have a different filesize in megabytes.

    I dunno, I would've dumbly thought that each clip would weigh the same. One clip is of a drumkit groove, another is of a piano riff, the third one is of a Hammond B3 organ riff. All clips feature "all playing, all the time", with almost no silent moments.

    Of the three, the organ playing weighs the most. All I can surmise is that, of the three clips, the organ is richest in frequencies, fat as it is with bass, midrange and treble frequencies.

    So my question is: When you export a digital WAV, just what is its filesize ultimately measured by? Number of samples? Amplitude of waveform? Frequency variation in waveform?

    A "busier" audio imprint yields more 1's and 0's for a computer system to store? This means that, let's say, a loud hard-rock clip of four bars, pegged to brickwall, will ultimately weigh more in filesize than the same four bars of quiet oboe playing?


    Thanks, ras


    Every paint-stroke takes you farther and farther away from your initial concept. And you have to be thankful for that. Wayne Thiebaud


    Friend me on FACEBOOK!

  • #2
    Originally posted by rasputin1963 View Post
    I've been uploading seamless loops of digital audio to an online website, and I've observed something interesting: If you take three WAV audio clips, each one recorded in 44100/16-bit, each one lasting 4 measures long, recorded in at 90BPM.... you'll find that each turns out to have a different filesize in megabytes.
    If they're radically different, then you're doing something different with them. There's no difference in file size between two recordings of exactly the same length because they will both have the same number of samples. One can be completely silent and the other can be filled with the wildest organ or drum parts you can play. But depending on how tight your cut it at the beginning and where you consider the end is because there will be some reverb trailing off at the end. And your timing may not be perfect.

    44.1 kHz means there are 44,100 samples in every second of your recording. Assuming you aren't corrupting this by recording at some other sample rate and resolution and converting it to 44/16 (different conversion algorithms can give slightly different results since the waveform is actually reconstructed and resampled mathematically) or you aren't involving lossy data compression in the process (starting with samples that you got as MP3 files, for instance) the numbers should check out. But remember, it doesn't take but a few milliseconds difference in recording length to make an observable difference in the size of the file.

    --
    "Today's production equipment is IT-based and cannot be operated without a passing knowledge of computing, although it seems that it can be operated without a passing knowledge of audio." - John Watkinson, Resolution Magazine, October 2006
    Drop by http://mikeriversaudio.wordpress.com now and then

    Comment


    • #3
      Possibly you may be comparing mono to stereo tracks?
      Don Boomer

      Comment


      • #4
        Are they REX files? They do lossless data compression.
        The first 3 books in "The Musician's Guide to Home Recording" series are available from Hal Leonard and http://www.reverb.com. Listen to my music on http://www.YouTube.com/thecraiganderton, and visit http://www.craiganderton.com. Thanks!

        Comment


        • #5
          Hmm, maybe it is the conversion causing the differences. I did indeed bounce all three clips down from 96kHz/32-Float to 44.1kHz/24-bit
          Every paint-stroke takes you farther and farther away from your initial concept. And you have to be thankful for that. Wayne Thiebaud


          Friend me on FACEBOOK!

          Comment


          • #6
            If they are both WAV files (not MP3), both stereo or both mono, and last the same amount of time, they should be the same size. If the tempo was much lower on one, it would last longer, and be a bigger file size.

            For WAVs it's simple math: 44100 samples/sec. For 16 bits, each sample is two bytes. For mono, 60 seconds would take 60 x44100 x 2 (about 5 MBytes). For stereo, double it.

            For your scenario, 90 BPM is 60000/90 = 666.67 mS per beat. (60000 is the milliseconds in one minute).
            4 Beats would last 2.667 sec.
            For mono, that would be 117600 samples, or 235200 bytes.
            Since a kilobyte is 1024 bytes, it would come out as 229.68 Kbytes or so.

            If they are BWFs (Broadcast Wav Files, which still use the .WAV file extension) it is possible to embed metadata (copyright, author, relative start time; etc.) into the files. It's possible that this could account for differences too.

            Since I'm already on the topic anyway, MP3 and WMF files are more complex; they basically code spectrum vs. time. For example, a 400 Hz beep lasting 1 second could be coded as 400, for a given number of frames (time divisions). So if the spectral content is complex, you get a larger file out of it than an equivalent loop with a simpler spectrum.
            Last edited by philboking; 09-27-2015, 02:59 PM.

            Comment


            • #7
              Thanks for doing the math. What Ras hasn't told us yet is just how much difference there is in file size. To be exact, you really have to be exact. When counting bytes, a couple of milliseconds goes a long way. If one is 20% longer than the other, that deserves some looking-into.
              --
              "Today's production equipment is IT-based and cannot be operated without a passing knowledge of computing, although it seems that it can be operated without a passing knowledge of audio." - John Watkinson, Resolution Magazine, October 2006
              Drop by http://mikeriversaudio.wordpress.com now and then

              Comment


              • #8
                Differences can be accounted for when it comes to data compression based on protocol used. Silence between notes for example may produce a thousand measurements between a beat that are exactly the same. Instead of sending a 1000 bits of identical readings the data is instead coded using a few binary digits to make the packet easy to move from point a to point be (liken an interface to a hard drive. Once at their destination these packets are recognized as being compressed and are decoded back into larger strings of binary numbers.

                This kind of compression is used in just about all kinds of digital data from fax, to video, communications you name it. You also have some kind of error correction with these kinds of files as well. If for some reason the packets don't make it from source to destination intact due to noise or jitter, they get retransmitted. The packets are counted at each end and are accounted for. (this is one reason for buffering)

                How many digits the files wind up being is going to be different to some degree depending on just how complex the sound wave is. A song with no silence between notes and having many complex transients occurring will not be compressed nearly as much as a song that has simple waveforms and silence between the notes so its going to wind up being larger.

                Comment


                • #9
                  When talking about data compression of audio files, it's very important to make a clear distinction between lossless encoding (like FLAC and the similar but proprietary Apple Lossless Audio Codec, ALAC). and lossy encoding like MP3, Ogg Vorbis, AAC (M4A), WMA, etc. The latter permanently remove 'less necessary' data (typically, bandwidth-sucking very high frequencies) that follows the perceptually 'crucial' initial parts of the wave forms (the human auditory system puts a far greater emphasis on the early parts of sounds than later). The amount of data compression is generally defined by the bitrate it takes to send a given format, for example, lo-fi-ish 128 kbps, mid-fi 192 kbps, 'hi fi' (or at least generally imperceptible loss) 320 kbps. For comparison, while a 320 kbps stereo 44.1/16 bit mp3 or other lossy file may have generally imperceptible loss, a true, full-data-size stereo 44.1/16 file has a bitrate of 1411 kbps.

                  Now, there are two truly lossless audio file formats in use, FLAC and Apple's very similar (but slightly less efficient) ALAC -- and they behave somewhat more like the kind of lossless data compression WRGKMC describes above, although his description of the algorithm might lead folks to conflate graphics and document compression schemes like JPEG and ZIP with the substantially different algos used in FLAC and ALAC.
                  Last edited by blue2blue; 09-28-2015, 09:55 AM.
                  .

                  music and social links | recent listening

                  Comment


                  • #10
                    I note that you say you have been uploading these WAV files. Are you looking at the filesize post-upload on some website?

                    If so, the guys at the receiving end of the website could be converting your files in some manner -

                    nat whilk ii

                    Comment


                    • #11
                      The original poster didn't say anything about compressed formats, he said WAV files. But, Nat, you have a good point. If it's not a web site that he controls, there may be some format conversion going on after the upload.

                      But I want to see NUMBERS!!!!
                      --
                      "Today's production equipment is IT-based and cannot be operated without a passing knowledge of computing, although it seems that it can be operated without a passing knowledge of audio." - John Watkinson, Resolution Magazine, October 2006
                      Drop by http://mikeriversaudio.wordpress.com now and then

                      Comment


                      • #12
                        Originally posted by MikeRivers View Post
                        But I want to see NUMBERS!!!!


                        What's in a word, eh?

                        Last edited by blue2blue; 09-29-2015, 05:43 PM.
                        .

                        music and social links | recent listening

                        Comment


                        • #13
                          Originally posted by MikeRivers View Post
                          Thanks for doing the math. What Ras hasn't told us yet is just how much difference there is in file size. To be exact, you really have to be exact. When counting bytes, a couple of milliseconds goes a long way. If one is 20% longer than the other, that deserves some looking-into.
                          This whole question arose because the loops website in question has a ceiling of 5Mb per uploaded loop. One loop I created was under 5Mb and thus was acceptable to upload; the B3 organ loop, also of four bars, 44.1/16 and same tempo... came to 5.66Mb. It was over the website's permitted ceiling, and thus was NOT accepted. All this isn't the end of the world, of course, but it is perplexing.
                          Every paint-stroke takes you farther and farther away from your initial concept. And you have to be thankful for that. Wayne Thiebaud


                          Friend me on FACEBOOK!

                          Comment


                          • #14
                            ^^^^ Put the file in and audio editor and do some trimming on the file. Trim the silence before the sound and after, then save it again and see how the file size changes. Try it again rolling off some treble, amplitude or some of the wave data then compare your finding. .

                            Comment


                            • #15
                              Except that it's a loop -- presumably already properly trimmed to the appropriate length for perfect looping.

                              Also, there's no reason why changing EQ or amplitude would affect a non-data-compressed file's size. A wav file header is 44 bytes long (not kb). The data space for a stereo 44.1/16 bit file should be able to be calculated by multiplying 1411 kilobytes (kb) x the number of seconds of audio or silence in the file. (Silence takes the same amount of space per second as audio in non-data-compressed files.)


                              http://www.topherlee.com/software/pc...wavformat.html

                              http://soundfile.sapp.org/doc/WaveFormat/
                              Last edited by blue2blue; 09-30-2015, 07:28 PM.
                              .

                              music and social links | recent listening

                              Comment


                              • WRGKMC
                                WRGKMC commented
                                Editing a comment
                                I was leading up to this since this topic deals with uploading files as you'll find in my next post. I suspect his upload site uses something like this or something similar. https://en.wikipedia.org/wiki/WavPack File size may be identical on his computer but once uploaded it can be vastly different. I haven't tested it but I suspect things like Amplitude and Frequency in a wave file will impact on line storage sizes on a server depending on the percentage it can be compacted to save drive space.
                                Last edited by WRGKMC; 10-01-2015, 09:10 AM.
                            Working...
                            X