saving 16-bit WAV results in binary difference

Feedback and Reviews for Audacity 2.x
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.

If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
hapbap
Posts: 3
Joined: Thu Nov 16, 2017 11:31 pm
Operating System: Windows 10

saving 16-bit WAV results in binary difference

Post by hapbap » Thu Nov 16, 2017 11:52 pm

Using Audacity 2.2.0. When opening a 16-bit PCM wav file and resaving it, it's not identical.
To reproduce the issue, follow these steps:

- set default sample format to 16-bit (Edit -> Preferences -> Quality)
- open an existing 16-bit wav file (let's say foo.wav)
- export to foo2.wav as a 16-bit PCM wav file
- do a binary comparison of foo.wav and foo2.wav, and see the wave data is not identical

To go even further, open foo2.wav and export it as foo3.wav, again as 16-bit PCM.
foo3.wav is neither identical to foo2.wav or foo.wav.

See attachment for binary comparison after saving once. It looks like a rounding error, or in other words: saving a 16-bit wav file as 16-bit wav file is lossy.
foo_foo2.png
foo_foo2.png (215.25 KiB) Viewed 697 times
Last edited by steve on Fri Nov 17, 2017 1:09 pm, edited 1 time in total.
Reason: Put image inline to preserve board layout

kozikowski
Forum Staff
Posts: 40417
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: OS X 10.9 Mavericks
Location: Los Angeles

Re: saving 16-bit WAV results in binary difference

Post by kozikowski » Fri Nov 17, 2017 3:44 am

That's correct. Audacity works internally at 32-bit floating in order to prevent damage when an effect or filter accidentally forces sound to "overload." 32-floating doesn't overload and it's just necessary to reduce the volume out of overload to recover the production. The AudioBook Mastering Suite depends on this process.

The down side to these gymnastics comes when you have to export back to 16-bit. It's possible to get significant errors at this step, so Audacity adds a dither signal to the export. This makes the show sound better but it drives the obsessives nuts.

If you want to take your chances, you can turn the dither system off in Preferences > Quality.

Koz

hapbap
Posts: 3
Joined: Thu Nov 16, 2017 11:31 pm
Operating System: Windows 10

Re: saving 16-bit WAV results in binary difference

Post by hapbap » Fri Nov 17, 2017 4:14 am

Thanks for the suggestion. Turning off dithering makes it save an identical wav file.

kozikowski
Forum Staff
Posts: 40417
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: OS X 10.9 Mavericks
Location: Los Angeles

Re: saving 16-bit WAV results in binary difference

Post by kozikowski » Fri Nov 17, 2017 4:37 am

Remember, tuning dithering off is only valid if you make no changes while the work is in Audacity. The first effect, filter or volume change is going to put you into the possible damage camp.

If all you're doing is listening, opening, closing, measuring, cutting, copying and pasting, You're pretty much good to go. Any effects including simple volume changes can cause problems.

Koz

steve
Site Admin
Posts: 47250
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu
Contact:

Re: saving 16-bit WAV results in binary difference

Post by steve » Fri Nov 17, 2017 9:00 am

There's an article in the Audacity wiki that explains the when and why for dither: http://wiki.audacityteam.org/wiki/Dither
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

hapbap
Posts: 3
Joined: Thu Nov 16, 2017 11:31 pm
Operating System: Windows 10

Re: saving 16-bit WAV results in binary difference

Post by hapbap » Fri Nov 17, 2017 3:12 pm

Got it, thanks again.

Post Reply