week4paug.net

Backstage: Paul's Workshop => Audio-related Tech Advice, Support & Discussion => Topic started by: twatts on January 09, 2014, 02:53:26 PM

Title: Familiar with ALAC files??? Need help...
Post by: twatts on January 09, 2014, 02:53:26 PM
I DLed some ALAC files...  How do I convert to WAV?

I know iTunes can do it, but is this process "lossless", ie will it produce WAVs that are EXACTLY like the originals???

If not, how do I go about re-creating those original WAV files???  I would rather not buy dbPowerAmp...

Thanks,

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: kellerb on January 09, 2014, 03:15:58 PM
Quote from: twatts on January 09, 2014, 02:53:26 PM
I DLed some ALAC files...  How do I convert to WAV?

I know iTunes can do it, but is this process "lossless", ie will it produce WAVs that are EXACTLY like the originals???

If not, how do I go about re-creating those original WAV files???  I would rather not buy dbPowerAmp...

Thanks,

Terry

I know foobar2000 can convert ALAC to WAV.  I *assume* it is a lossless process, but I don't have documentation that it is bit-perfect.
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 09, 2014, 03:20:19 PM
Quote from: kellerb on January 09, 2014, 03:15:58 PM
Quote from: twatts on January 09, 2014, 02:53:26 PM
I DLed some ALAC files...  How do I convert to WAV?

I know iTunes can do it, but is this process "lossless", ie will it produce WAVs that are EXACTLY like the originals???

If not, how do I go about re-creating those original WAV files???  I would rather not buy dbPowerAmp...

Thanks,

Terry

I know foobar2000 can convert ALAC to WAV.  I *assume* it is a lossless process, but I don't have documentation that it is bit-perfect.


Maybe I need to reinstall Foobar, but mine came up with errors whenever I tried to use it...

I'd hate to assume, though I'm going to have to do so anyways...  The person who provided the ALAC refuses to provide a WAV MD5...

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: VDB on January 09, 2014, 03:34:11 PM
ALAC is lossless, so would not any other lossless format you convert it into also be lossless? Where would the losses be lost to?
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 09, 2014, 03:54:09 PM
Quote from: V00D00BR3W on January 09, 2014, 03:34:11 PM
ALAC is lossless, so would not any other lossless format you convert it into also be lossless? Where would the losses be lost to?

My question is not about whether or not its "lossless", I'm sure that it is...

My question is whether or not there is a process by which I can re-create the original WAV files from the ALAC, like you can do with FLAC. 

I'm concerned about my WAV MD5s matching the originals...

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: Superfreakie on January 09, 2014, 09:08:58 PM
You only need the trial version for dbpoweramp if you are only going to use it to do conversions. Get the trial version and the necessary codecs, then when the 21 days are up, all that happens is that you can no longer use it as a CD burner nor use it to encode tracks BUT you will always be able to use it to convert files. Which is why you wanted it for in the first place. It's a a great program and really accurate. 
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 10, 2014, 12:16:20 AM
Quote from: Superfreakie on January 09, 2014, 09:08:58 PM
You only need the trial version for dbpoweramp if you are only going to use it to do conversions. Get the trial version and the necessary codecs, then when the 21 days are up, all that happens is that you can no longer use it as a CD burner nor use it to encode tracks BUT you will always be able to use it to convert files. Which is why you wanted it for in the first place. It's a a great program and really accurate.

Converting ALAC to WAV isn't really an issue, it whether or not the resulting WAV files would be the exact same as the original WAV files... 

Testing on my own part:  converting ALAC > WAV with iTunes and again with Foobar give you (2) different results, which produce (2) different MD5s, which (of course) fail verification when used with the "other" set of WAV files... 

Terry

Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 10, 2014, 12:18:49 AM
Quote from: Superfreakie on January 09, 2014, 09:08:58 PM
You only need the trial version for dbpoweramp if you are only going to use it to do conversions. Get the trial version and the necessary codecs, then when the 21 days are up, all that happens is that you can no longer use it as a CD burner nor use it to encode tracks BUT you will always be able to use it to convert files. Which is why you wanted it for in the first place. It's a a great program and really accurate.


Yeah...  I must have had dbPA installed at one point b/c it won't install now for whatever reason...  It says I have to buy it for it to do anything... 

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: sls.stormyrider on January 10, 2014, 02:16:30 PM
try XLD
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 10, 2014, 02:57:40 PM
Quote from: slslbs on January 10, 2014, 02:16:30 PM
try XLD

Will this what I need, or is just another converter???  And I have a PC, not a MAC, can I still use it??? 

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: sls.stormyrider on January 10, 2014, 04:07:08 PM
It is a convertor, but it may do what you want and convert w/o changing the MD5. I never checked it.

It is a free MAC program.

I didn't know you can run ALAC on a PC
Title: Re: Familiar with ALAC files??? Need help...
Post by: jasonsobel on January 11, 2014, 06:27:35 PM
ALAC should be natively supported by foobar.

When playing a FLAC file in foobar, there's an easy way to view the audio checksums.  I assume that it does the same thing with ALAC. After you use foobar to decode, generate a set of shntool md5's (aka st5's) with trader's little helper on the wav files.  The st5 should match the audio checksum of the ALAC file in foobar, and this will confirm that the decode back to WAV was lossless.
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 11, 2014, 06:39:13 PM
Quote from: jasonsobel on January 11, 2014, 06:27:35 PM
ALAC should be natively supported by foobar.

When playing a FLAC file in foobar, there's an easy way to view the audio checksums.  I assume that it does the same thing with ALAC.

How do I do this???  OK I figured it out...  When you view the Properties on a FLAC file, it shows the checksum...  Does NOT do the same thing for ALAC...

Quote from: jasonsobel on January 11, 2014, 06:27:35 PM
After you use foobar to decode, generate a set of shntool md5's (aka st5's) with trader's little helper on the wav files.  The st5 should match the audio checksum of the ALAC file in foobar, and this will confirm that the decode back to WAV was lossless.

Thanks!

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: jasonsobel on January 11, 2014, 08:27:18 PM
Quote from: twatts on January 11, 2014, 06:39:13 PM
When you view the Properties on a FLAC file, it shows the checksum...  Does NOT do the same thing for ALAC...

bummer.  probably displays the checksum for FLAC, because FLAC stores the checksum in the header as a metadata tag (which is why it's so quick to generate an FFP file, it's just reading the FFP that is already calculated and stored in the metadata, rather than calculating the checksum again).  I guess ALAC doesn't store the checksum in the header?  (I've never used ALAC, so I don't really know).

anyway, not sure if the st5 of the decoded WAV file will help, if foobar doesn't give you the checksum of the ALAC, then you have nothing to compare it to.

like I said, I've never used ALAC.  I'm curious now, can you send me one of the ALAC files?

also, just generally speaking, foobar is a great program, and even if we can't figure out a way to verify that the files was losslessly decoded, I think it's safe to "trust" foobar.  for example, if you try to convert between lossy formats (mp3 to ogg, for example), it'll give you a warning and tell you why a lossy to lossy transcode is bad.  based on this experience, I would expect foobar to give you some error or warning if it wasn't a lossless conversion from ALAC to WAV.  The folks behind foobar definitely know what they're doing, and since ALAC went open source a few years ago, it's very easy to have ALAC implemented correctly.  So you really should not have any issues.


Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 11, 2014, 09:34:39 PM
Quote from: jasonsobel on January 11, 2014, 08:27:18 PM
Quote from: twatts on January 11, 2014, 06:39:13 PM
When you view the Properties on a FLAC file, it shows the checksum...  Does NOT do the same thing for ALAC...

bummer.  probably displays the checksum for FLAC, because FLAC stores the checksum in the header as a metadata tag (which is why it's so quick to generate an FFP file, it's just reading the FFP that is already calculated and stored in the metadata, rather than calculating the checksum again).  I guess ALAC doesn't store the checksum in the header?  (I've never used ALAC, so I don't really know).

anyway, not sure if the st5 of the decoded WAV file will help, if foobar doesn't give you the checksum of the ALAC, then you have nothing to compare it to.

like I said, I've never used ALAC.  I'm curious now, can you send me one of the ALAC files?

also, just generally speaking, foobar is a great program, and even if we can't figure out a way to verify that the files was losslessly decoded, I think it's safe to "trust" foobar.  for example, if you try to convert between lossy formats (mp3 to ogg, for example), it'll give you a warning and tell you why a lossy to lossy transcode is bad.  based on this experience, I would expect foobar to give you some error or warning if it wasn't a lossless conversion from ALAC to WAV.  The folks behind foobar definitely know what they're doing, and since ALAC went open source a few years ago, it's very easy to have ALAC implemented correctly.  So you really should not have any issues.

I did get an error:

Quote
1 out of 1 tracks converted with minor problems.

Source: "F:\_ARCHIVE\Malkmus\2009\malkmus2009-05-08\original ALAC files\09.m4a"
  Error flushing the decoder: Unsupported format or corrupted file

I did some Googling and found this:  http://www.hydrogenaudio.org/forums/index.php?showtopic=65895
and this:  http://www.head-fi.org/t/656315/alac-md5-checksum-inconsistency

I'll email you a file to play with...

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: jasonsobel on January 11, 2014, 10:05:37 PM
and there's our answer:

the last post of this thread (which you linked to):
http://www.head-fi.org/t/656315/alac-md5-checksum-inconsistency

leads to the Binary Comparator component for foobar:
http://www.foobar2000.org/components/view/foo_bitcompare

download and install that component.

interestingly, when decoded the ALAC file to WAV, I got the same error:

Quote1 out of 1 tracks converted with minor problems.

Source: "F:\_ARCHIVE\Malkmus\2009\malkmus2009-05-08\original ALAC files\09.m4a"
  Error flushing the decoder: Unsupported format or corrupted file

BUT, even with the error, I ended up with a WAV file.  Then, using the Binary Comparator component, I was able to verify that the audio streams in the ALAC and in the WAV were identical.

QuoteAll tracks decoded fine, no differences found.

Comparing:
"E:\temp\09.m4a"
"E:\temp\09.wav"
No differences in decoded data found.


from this page:
http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components_0.9/foo_bitcompare

QuoteThis is useful to verify whether different files - typically lossless files - contain exactly the same audio data. The component compares only decoded audio data, presence of tags does not affect the results.

and that's exactly what you're trying to do.  Now, I don't know what exactly the issue is with the "minor problem" that foobar reports.  but my guess is that it's some weird header or something in the ALAC, and that it's something that doesn't actually affect the audio.
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 11, 2014, 10:08:40 PM
Quote from: jasonsobel on January 11, 2014, 10:05:37 PM
and there's our answer:

the last post of this thread (which you linked to):
http://www.head-fi.org/t/656315/alac-md5-checksum-inconsistency

leads to the Binary Comparator component for foobar:
http://www.foobar2000.org/components/view/foo_bitcompare

download and install that component.

interestingly, when decoded the ALAC file to WAV, I got the same error:

Quote1 out of 1 tracks converted with minor problems.

Source: "F:\_ARCHIVE\Malkmus\2009\malkmus2009-05-08\original ALAC files\09.m4a"
  Error flushing the decoder: Unsupported format or corrupted file

BUT, even with the error, I ended up with a WAV file.  Then, using the Binary Comparator component, I was able to verify that the audio streams in the ALAC and in the WAV were identical.

QuoteAll tracks decoded fine, no differences found.

Comparing:
"E:\temp\09.m4a"
"E:\temp\09.wav"
No differences in decoded data found.


from this page:
http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components_0.9/foo_bitcompare

QuoteThis is useful to verify whether different files - typically lossless files - contain exactly the same audio data. The component compares only decoded audio data, presence of tags does not affect the results.

and that's exactly what you're trying to do.  Now, I don't know what exactly the issue is with the "minor problem" that foobar reports.  but my guess is that it's some weird header or something in the ALAC, and that it's something that doesn't actually affect the audio.

Too funny, I just saw that and I'm getting ready to run my own tests... 

Thanks!  Now I can get rid of these ALAC files!  Woohoo!

Terry
Title: Re: Familiar with ALAC files??? Need help...
Post by: twatts on January 11, 2014, 11:28:14 PM
A summary of Jason and my own Experiments with ALAC > WAV > FLAC via foobat, shntools, and TLH...

1. Foobar can do a "perfect" decode of ALAC to WAV.
2. The resulting WAV file is OK per Bit Compare for Foobar.
3. Comparison b/w the M4A and resulting WAV show "No differences in decoded data found".
4. However, the resulting WAV has "extra RIFF chunks" per SHNTOOLs.
5. This will result in WAV MD5s that may be erroneous.
6. Using the "Strip" function with SHNTOOLs will correct this problem.
7. Converting the non-stripped WAV to FLAC with Traders Little Helper will also correct this problem (unless you "keep foreign metadata").
8. The "stripped" WAV files and the WAV > FLAC > WAV files via TLH will give you the same WAV MD5.

Thanks to Jason for all the help and the initial testing.  He also helped by reviewing my own experiments... 

Terry


Title: Re: Familiar with ALAC files??? Need help...
Post by: sls.stormyrider on January 12, 2014, 09:41:44 AM
out of curiosity, what is a extra RIFF chunk?

I googled it, and the best i can tell it is just a way of labelling / tagging the file.
?true?
Title: Re: Familiar with ALAC files??? Need help...
Post by: Marmar on January 12, 2014, 10:16:57 AM
RIFF data is basically the bytes of metadata that helps programs determine what the container is/holds.....The RIFF format acts as a "wrapper" for various audio compression codecs.

AIFF is the Apple format.

In the simplest of descriptions, it tells windows/programs if it is a format, or strictly data.....what container......size.....padding....cue points.....etc.

Quote"CHUNKS" are a fragment of information which is used in many multimedia formats, such as PNG, IFF, MP3 and AVI....etc

Each chunk contains a header which indicates some parameters (e.g. the type of chunk, comments, size etc.) In the middle there is a variable area containing data which are decoded by the program from the parameters in the header.

Since wav data has a lot of duplicate info in the chunks (hence why lossless encoding is possible) going from one codec to another may produce extra data that wasn't "needed" by one or the other codecs.....in that case you end up with extra CHUNKS of data (usually 0s) that gets stored in the file header info.