VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Member
    Join Date
    Jan 2007
    Location
    United States
    Search PM
    I'm using Audacity 1.3.12 on XP.

    I noticed that if I export audio to a file (any format), and then export the audio again to another file, the 2 files are different when I compare them. I thought they would be the same, but they're not. I tried it multiple times with all the different output formats (WAV, MP3, AIF, AC3, etc), and Audacity just does not save the file the same way twice. Is there some sort of random number generator used when saving a file???
    Quote Quote  
  2. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Different in what way? - comparing them with what?
    Quote Quote  
  3. Member
    Join Date
    Jan 2007
    Location
    United States
    Search PM
    Different in that file contents are not the same. Using a file comparison tool and it shows the binary data is different.

    If I save the audio to a file, and then immediately save it to another file without doing any changes, you would expect those 2 files to be the same, right? But they're not.
    Quote Quote  
  4. VH Wanderer Ai Haibara's Avatar
    Join Date
    Jan 2006
    Location
    Somewhere on VideoHelp...
    Search Comp PM
    Have you tried exporting them to a lossless format (like FLAC; I think the latest (beta) version of Audacity, combined with the ffmpeg plugin, allows for that), and compared the results from that? As far as I know, compressing to lossy formats doesn't always provide the same (identical) results, even when creating two versions of the same audio track, using the same compression settings for both.

    You can always try the experiment with a different converter/encoder (other than Audacity, I mean) and see if the same thing happens.
    If cameras add ten pounds, why would people want to eat them?
    Quote Quote  
  5. Member
    Join Date
    Jan 2007
    Location
    United States
    Search PM
    Yeah I just did a test. Loaded WAV file 1 into Audacity, and then exported it to WAV file 2. Then closed Audacity, and re-opened Audacity and loaded WAV file 1 again. Exported it to WAV file 3. You would think WAV file 2 and WAV file 3 would be the same, right? They are the exact same size, but according to my file comparison tool, they are very different (over 1000 differences). Weird.
    Quote Quote  
  6. I believe Audacity works internally in floating point. So even when importing an uncompressed WAV and exporting again as an uncompressed WAV there will be rounding errors. Sequential exports appear to generate successively more errors so I'm guessing it re-imports the integer data as it's exporting.
    Quote Quote  
  7. Member
    Join Date
    Aug 2004
    Location
    PA USA
    Search Comp PM
    It's the mathematics going in, and coming out differently, which is why (I do not want a flame war over this) some scientists think that god is code.
    Quote Quote  
  8. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Is that MD5 Hash comparison? Yes, a unique number is generated, it's called a GUID.
    Quote Quote  
  9. Originally Posted by sldvd View Post
    Yeah I just did a test. Loaded WAV file 1 into Audacity, and then exported it to WAV file 2. Then closed Audacity, and re-opened Audacity and loaded WAV file 1 again. Exported it to WAV file 3. You would think WAV file 2 and WAV file 3 would be the same, right? They are the exact same size, but according to my file comparison tool, they are very different (over 1000 differences). Weird.
    You don't even have to open the file you saved and save again. You can just export several times in a row and every file will be different. It isn't just header info or metadata that's changing -- the audio data itself is changing even if you are saving as uncompressed PCM.
    Quote Quote  
  10. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    What are you using to do your comparison, and are you sure it isn't this tool at fault ?
    Read my blog here.
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    I believe Audacity works internally in floating point. So even when importing an uncompressed WAV and exporting again as an uncompressed WAV there will be rounding errors.
    There shouldn't be any rounding errors converting (in either direction) between 16 bit integer and 32 bit float (when no filters have been applied). Perhaps what is happening is the 32 bit to 16 bit conversion does some dithering which introduces a random variation on the least significant bits.
    Quote Quote  
  12. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Sign up at the Audacity Forum and ask the actual developers what's going on.
    http://forum.audacityteam.org/
    Quote Quote  
  13. Originally Posted by guns1inger View Post
    What are you using to do your comparison, and are you sure it isn't this tool at fault ?
    Command line "FC /B FILEA.WAV FILEB.WAV". And a hex editor viewing both files side by side.

    Originally Posted by Gavino View Post
    Perhaps what is happening is the 32 bit to 16 bit conversion does some dithering which introduces a random variation on the least significant bits.
    You're right. It even happens when the editing format is the same as the import and export formats. I created a 16 bit, 44,100 Hz, stereo WAV file, imported into Audacity set to work in 16 bit 44,100 Hz stereo, then exported the file four times in a row. Every file was different with noise ranging from about +/- 4 units.

    There are two dithering setting in Audacity (Edit -> Preferences -> Quality) in a section called Conversion: Real Time and High Quality. It looks like Real Time applies to playback within the program, High Quality when the data is saved. The dithering is applied even if the working format is the same as the output format and no changes have been made, not just on "conversion" between float, 24 bit, and 16 bit. After disabling the High Quality Dithering the exported file is the same as the source.
    Last edited by jagabo; 22nd Nov 2010 at 06:47.
    Quote Quote  
  14. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Investigating my hunch about dithering, I found that if you go into Preferences->Quality and set Dither for 'High-quality Conversion' (used on export to a file) to 'None', then exporting to 16-bit wav produces identical results each time.

    Case proved?
    Quote Quote  
  15. Oh, and after disabling the dithering setting the exported data was the identical as the imported data even when the input and output were 16 bit integer but the working format was float.
    Quote Quote  
  16. Member
    Join Date
    Jan 2007
    Location
    United States
    Search PM
    Thanks guys, it was the dithering causing the files to be different every time. I read that it introduces a random element.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!