Help - Search - Members - Calendar
Full Version: TTA not lossless?
Hydrogenaudio Forums > Lossless Audio Compression > Lossless / Other Codecs
ktf
I was running some tests for my codec comparison mentioned here when I noticed that TTA was lossy!

CODE
> md5sum *.wav
b8ef0372c5bdc674fe8c5dc2986d2d8d  original.wav
10402c6aa07251fdd0ba8b28072db8f9  encode_decode.wav
10402c6aa07251fdd0ba8b28072db8f9  second_encode_decode.wav


That second encode/decode was an encode->decode of it's own output file, not the original, to show it is lossless after its own lossy operation. wink.gif

While FLAC is lossless here, so it isn't a problem with foreign metadata. You can download the track in FLAC here: http://www.2l.no/hires/index.html, I tested A. Vivaldi: Recitative and Aria from Cantata RV 679, "Che giova il sospirar, povero core" and B.Britten: Simple Symphony, Op. 4 - Boisterous Bourrée, the results above are of this last one, but the test results say TTA has problems with the other too.

I can't analyse the problem: I don't hear any difference on my stereo setup, I don't have a surround setup and I don't have an audio analyser/editor that supports multichannel, (AFAIK Audacity doesn't) so I don't know if TTA shifts the channels, lowers the resolution or something other.

So, out of curiosity, I tested the 192kHz/24-bit recording which I used here, and I got this:

CODE
> md5sum *.wav
7110d31ad0ebf38d80eb676d286de079  SolidInc 192kHz.wav
7110d31ad0ebf38d80eb676d286de079  encode_decode.wav


I used TTA1 lossless audio encoder/decoder, release 3.4.1, so I guess True Audio isn't that true tongue.gif

Edit: there was some foreign metadata in SolidInc 192kHz.wav, so I tested again, and it works.
Yirkha
Or maybe you just fail at comparing the files.

WAV is a container format, it has a header which can have different content even when the audio samples itself are the same. Or there can simply be some unused padding space in the file. You should compare the raw PCM data or use a dedicated tool to bit-compare only the audio data.
ktf
But I've tested quite a lot of (16-bit/44.1kHz) files like this, which was never a problem, also not with TTA. Why would it be a problem right now?

Okay, probably it is. I see the last file (SolidInc) has some WAV metadata which I overlooked. How do I check the RAW PCM? I prefer a method that is easily automated. I work on Linux.
ktf
Just tried an HEX editor, and it showed that the audio data is exactly the same in the same place if I alter the headers. So although I haven't checked everything bit-for-bit, I'm pretty sure the audio data is identical.

Sorry for the noise. smile.gif

Edit: Still I have the question: is there an easy to automate way on Linux to check WAV-files bit-by bit, but only their raw PCM data?
.halverhahn
For checking the files you can use the Bitcompare tool in foobar.
Justin Ruggles
QUOTE (ktf @ May 20 2009, 11:48) *
Just tried an HEX editor, and it showed that the audio data is exactly the same in the same place if I alter the headers. So although I haven't checked everything bit-for-bit, I'm pretty sure the audio data is identical.

Sorry for the noise. smile.gif

Edit: Still I have the question: is there an easy to automate way on Linux to check WAV-files bit-by bit, but only their raw PCM data?

If you're looking for something you can use in Linux, FFmpeg has a tool called tinypsnr, but you would have to know the header size. Currently I use the wavinfo tool from Flake to get the header and data sizes, then use dd to extract the raw audio, and run md5 on that. Something simpler would be useful to me as well, so maybe I could add raw md5 calculation to the Flake wavinfo tool.

edit: I guess another way would be to do a quick FLAC -0 encode and list the MD5 with metaflac.
tuffy
Python Audio Tools has a trackcmp utility, which compares only the PCM samples of two audio tracks. It displays nothing if they match, and an error if they don't (analagous to the standard cmp command).
Mark0
You can also use my humble RIFFStrip to extract only the audio data.

Bye!
Yirkha
Or using `mplayer -ao pcm:nowaveheader input.wav; md5sum audiodump.pcm; rm audiodump.pcm`

Works even with e.g. FLAC without dumping it to a WAV first, naturally.
Also you might try something like `mplayer --really-quiet -ao pcm:nowaveheader,file=- input.wav | md5sum` directly, though it didn't work for me on Windows.
ktf
All nice options smile.gif Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.