Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Help converting FLAC/APE files to ALAC on a Mac (Read 38426 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help converting FLAC/APE files to ALAC on a Mac

You guys have sold me.  I'm going to convert my FLACs to ALAC and then keep a lossy collection as well. 

I thought I would already start tonight, but it turns out that XLD has a few settings for ALAC, so now I need to read up on what they're all about.  (I'm pretty ignorant that way.)  I'm kind of surprised that lossless has "settings".  It would seem that there wouldn't be different quality levels of lossless, but XLD has settings for sample rate and bit depth, neither of which I know anything about with regards to ALAC.  Also don't know anything about embedding cue sheets as a chapter during conversion. 

I'm sure someone on this forum has already discussed these things.  If they have, I'll find it and figure out what I'm doing.

Thank you for your help, everyone that replied.

Help converting FLAC/APE files to ALAC on a Mac

Reply #1
You guys have sold me. I'm going to convert my FLACs to ALAC and then keep a lossy collection as well.
Good advice from "the guys". I'm sure the audio will be converted without loss.
It might be a good idea though to verify if all your (precious?) FLAC metadata transfer correctly to ALAC before you start to convert your whole collection.

Help converting FLAC/APE files to ALAC on a Mac

Reply #2
First, you do of course a backup? If not, then this is the right time to do one.  Keep your FLACs as of now.  At least until you know that everything went well. 

Keep folder structure.  (Import the FLACs as a playlist, import the ALACs as a playlist, use a bitcompare utility.)  Your player may sort incoming so that this is not an issue, but unless you know what you are doing, keep everything as equal as possible.


I'm kind of surprised that lossless has "settings".  It would seem that there wouldn't be different quality levels of lossless


- The audio signal will be identical, unless you set it to do conversion to e.g. a different sampling frequency (44.1 in should be 44.1 out) or number of bits per sample (if you have a 24 bit file and convert it to 16, you will not get the same out).  Make sure you keep output as source. 


- A lossless encoder will also have settings for how much CPU it should use to encode.  Many .zip packers also have this.  The encoder tries to find patterns it can exploit in order to pack the signal tighter, and that takes more CPU cycles and more time.  You can very well set the encoder at a high compression rate if you have time to wait.  Encoding is done once. 


(I cannot give any help on settings on appleware, but others likely can.)

Help converting FLAC/APE files to ALAC on a Mac

Reply #3
Holy smokes.  I am really humbled by all the attentive help on this forum.  Thank you VERY much, all of you who responded.


It might be a good idea though to verify if all your (precious?) FLAC metadata transfer correctly to ALAC before you start to convert your whole collection.



Yes, very precious.  I have many FLACs of important classical and jazz albums that are no longer in print.  If something went wrong, I would have a difficult, if not impossible, time replacing these files.  Yes, I also do keep a backup on a separate drive.

Very good suggestion about verifying the conversion, of course.  I read that XLD has the ability to "confirm" rips from CD, although I have not yet learned how to do that.  Does anyone know if XLD can confirm if a transcode worked properly from FLAC to ALAC ... or is there some other way of confirming this?

Also very important to me, is the ability to confirm that all the gapless information was handled properly.  The last time I tried to convert any media was perhaps ten years ago using iTunes to rip my CDs to compressed files.  iTunes at the time did not yet have it's gapless technology together and the gaps were messed up.  I was so traumatized by the incident, I haven't transcoded anything since!  (And the only reason I'm willing to try again now is because so many people on this forum speak so highly of XLD.)

So would I be able to verify the data, including the gapless/pregap info, from FLAC/APE to ALAC using XLD?  That would REALLY be some comforting assurance, since I obviously can't listen to hundreds of albums just to make sure they made the switch properly.

That would allow me to make the dream a reality ... transcode all the FLACs/APEs to ALAC, backup the new iTunes-friendly files to the second drive, and in the process delete the FLACs entirely.  I would have to be VERY confident in the software and the transcoding verification to do that, though.


Help converting FLAC/APE files to ALAC on a Mac

Reply #5
There is no need to be concerned about gapless playback when converting from flac to alac.  Lossless is lossless!


Thanks, greynol.  Just so I'm sure of what you're saying ... whether I have multiple-track FLACs with a CUE, or one album flac with a CUE, or multiple-track FLACs without a CUE ... there is no setting in XLD I can accidentally leave ticked on or off or with a wrong value set (etc) that would cause me to mess up the gaps?  That problem I had with iTunes screwing up my gaps ten years ago no longer exists?

This is the one issue that caused me to give up on encoding my CDs ten years ago and freaked me out on the idea of trusting conversion software ever since, so please forgive the persistent questions.

Help converting FLAC/APE files to ALAC on a Mac

Reply #6
The problem with gapped playback has to do with lossy encoding.

Also, gapped playback really has nothing to do with cue sheets, other than people have used them to index a mp3 created from a wave file of the entire CD.

The word gaps might be the same but their meaning is completely different.

Help converting FLAC/APE files to ALAC on a Mac

Reply #7
That would allow me to make the dream a reality ... transcode all the FLACs/APEs to ALAC, backup the new iTunes-friendly files


If you have access to a Windows computer, then you would easily get help doing both copying (directory structure preserved, and with additional files like .log and .jpeg moved) and verification with foobar2000.

Do however make sure that tags - including embedded album art! - are transferred correctly. FLAC allows arbitrary tag names, I don't know if ALAC does. As for album art: be sure to test one album with multiple pictures embedded (if you have any such).

Help converting FLAC/APE files to ALAC on a Mac

Reply #8
... gapped playback really has nothing to do with cue sheets, other than people have used them to index a mp3 created from a wave file of the entire CD.

The word gaps might be the same but their meaning is completely different.


Well, now you completely lost me, greynol.  My (limited) understanding is that the gaps between songs is either an actual break between the files, determined by the player, or in the case of gapless, the transition between files is seamless, but the moment of silence is actually a part of the song.  And the problem in transcoding is when the exact length of the gap/gapless is not carried over and the transcode reverts to some default amount of time, resulting in an wanted gap in, say, a continuous live album.

And my limited understanding of cue sheets holding gap data simply comes from me dropping the small cue sheet file onto the XLD icon and up pops the whole album in the transcode window with pregap values already filled in. 

But again, that's just a bunch of heartache talking that came out of trying to transcode my large CD collection ten years ago when iTunes was notoriously inept at handling gaps perfectly.  (I continuously got live albums with brief gaps between songs.)  It's also my only last concern about transcoding FLACs to ALAC, since XLD does seem pretty straightforward with regard to settings.  There's not too much there for me to learn or screw up.  It'll either do it right or it won't.

I have no idea what you mean by "the word gaps might be the same but their meaning is completely different".  Maybe it's not important for me to know.  If you say that gaps are no longer an issue with XLD, as they were with iTunes, then I can leave it at that.



If you have access to a Windows computer, then you would easily get help doing both copying (directory structure preserved, and with additional files like .log and .jpeg moved) and verification with foobar2000.

Do however make sure that tags - including embedded album art! - are transferred correctly. FLAC allows arbitrary tag names, I don't know if ALAC does. As for album art: be sure to test one album with multiple pictures embedded (if you have any such).



Sadly, I do not.  I have a brand new iMac with XLD, but no PCs around.  What you're saying though is exactly what I want ... just the ability to transcode to ALAC and then use some reliable verification system, so I'm not doing some silly thing like actually listening to album after album to see if they transcoded properly with the correct song gaps.  That doesn't work when we're talking hundreds and hundreds (and hundreds) of FLACs.

I read good things about XLD as a transcoder, and I've read where people refer to "secure ripping", (which I assume applies only to transcoding from actual CDs), but I haven't read about any such feature that will let me confirm the transcode from FLAC to ALAC.


It's starting to sound like I'm going to have to keep all my original FLACs (plus their backups, that's two separate drives) in addition to the new ALACs (plus their backups, again on a separate drive) so that if an ALAC is found to be bad, I can go back to the original FLAC to do it over properly.

I sure wish there was some Mac alternative to this Foobar2000 software you're talking about.  Transcode to ALAC and verify the lossless file.  How hard should that be to get on a Mac?



Help converting FLAC/APE files to ALAC on a Mac

Reply #9
The audio data on the disc either contains silent sections at track transitions or it doesn't.  How these transitions are indexed is not relevant unless you tell your ripping or image splitting program to do something non-standard.  The standard way of ripping to PCM as one track per file (and any compressed lossless format) will keep these transitions exactly as they are on the disc unless the ripping program is broken or somehow configured to do something non-standard (intentionally or otherwise).  If you convert from one lossless format to another the audio data remains the same, otherwise it isn't lossless.  If the audio data remains the same and the transitions are in the audio data then the track transitions will also remain the same.  EDIT: The same is true when ripping an entire album to a single file.

In the previous paragraph I mentioned transitions being indexed.  This is information in the sub-channel data, not the audio data.  This sub-channel information is stored in the cue sheet if it was detected by the ripping program.  If you want to see the contents of a cue sheet, open it up with a text editor.  On an audio compact disc, gaps, pregaps, pre-gaps, 00 indices, 00 indexes, whatever you want to call it, are just areas in the audio that are labeled in the sub-channel data.  These areas may be digitally silent, may contain low-level noise, may contain signal, or any combination.

These areas indexed in the sub-channel are not the same thing as whether your software or hardware media player is able to properly transition from the last sample of the previous file to the first sample of the current file.  Whether this transition when changing files can be done correctly with a lossy format depends on the capability of the encoder and whether it plays nicely with a player that is capable of gapless playback.  Whether this can be done correctly with a lossless format only depends on the capability of the player.  It has nothing to do with the encoder because the encoder is lossless.

Lossless is lossless is lossless is lossless.  If it isn't lossless then something is broken.

Help converting FLAC/APE files to ALAC on a Mac

Reply #10
Exceptional explanation, greynol.  Thank you.  That post should become an FAQ answer, if anyone else were asking this question.   

Can you give me any insight into the question in the second half of my post?  Pregaps and confirming my transcodes are really my only two concerns since resolving to use ALAC.  Since you've assured me that any gap issues I experience would only be as a result of the source file or playback software, that's no longer an issue.

Do you have a suggestion for what to do (or where to learn) about confirming the FLAC to ALAC conversion?  Again, I'm on a Mac using XLD.


Help converting FLAC/APE files to ALAC on a Mac

Reply #11
Other than possibly to change the file name and file type in the cue sheet, the rest of the information should stay the same so pregaps should not be an issue.

I'm strictly a Windows guy so I can't help you with verifying the integrity of lossless conversion on a Mac.  A simple, efficient and effective way to do this is to:

1) convert flac to alac
2) decode alac to raw pcm
3) find the md5 hash of the pcm
4) compare this hash with that stored in the flac file

About cue sheets, their true intended purpose is to help create a more perfect replica of the disc when burning to CD-R/RW.  The use of cue sheets has evolved, though aside from indicating whether a disc has pre-emphasis, they are not necessary if your tracks are stored as individual files and you don't intend to burn copies.  The limited metadata they contain should already be present in the files themselves, with the possible exception of ISRC/UPC data which is of questionable value.

Of course if you are ripping to single-file images, CUE sheets are indispensable; though converting a single-file image form one lossless format to another will still not cause or necessitate a change in the sub-channel data found in the cue sheet.

Help converting FLAC/APE files to ALAC on a Mac

Reply #12
Thanks, greynol.  That sounds easy after I've done it a few times.  Looks right now like a bunch of steps to repeat for each of the hundreds of FLACs I'll be converting.

Let me please put the question out there for the Mac-savvy members ...

... is anyone confirming their FLAC/APE to ALAC conversions?  How are you doing it?

Or is there even a reason to?  Perhaps XLD executes the conversions with such perfect reliability that a confirmation is not even necessary?

-J

Help converting FLAC/APE files to ALAC on a Mac

Reply #13
Looks right now like a bunch of steps to repeat for each of the hundreds of FLACs I'll be converting.


It is possible to run command lines on appleware ...

What you would want, is something that looks for every
X:\<path>\<filename>.FLAC
looks up
Y:\<same path>\<same filename>.ALAC
and compares them, and yells if it doesn't find the file or if it does not match.  Re greynol's suggestion: AFAIK, there is no checksum in ALAC, so it has to be decoded and md5sum generated. (You could convert back to FLAC and use metaflac on both, but ...)

I did a search for audio comparing software under OS X. Found one hit on this forum, that is 10 years old ... http://www.hydrogenaudio.org/forums/index....showtopic=21267



Looks right now like a bunch of steps to repeat for each of the hundreds of FLACs I'll be converting.

Let me please put the question out there for the Mac-savvy members ...


This thread title might not attract the right answers.


Sure you cannot borrow someone's Windows computer for a night?

Help converting FLAC/APE files to ALAC on a Mac

Reply #14
... is anyone confirming their FLAC/APE to ALAC conversions?  How are you doing it?
Do you know xACT? It's a great utility for Mac. I haven't used it to convert to ALAC, but it's versatile and the developer is very responsive. XLD and xACT have overlapping features, but it's great to have them both. xACT has checksum features, so it might do the trick for you.

Help converting FLAC/APE files to ALAC on a Mac

Reply #15
Do you know xACT? It's a great utility for Mac. I haven't used it to convert to ALAC, but it's versatile and the developer is very responsive. XLD and xACT have overlapping features, but it's great to have them both. xACT has checksum features, so it might do the trick for you.


Thanks for the suggestion Kees.  I've never opened xACT because I read that XLD is easier to use ... and I have a vague memory of someone saying that xACT doesn't do ALAC.  But that's just a fuzzy memory from reading too many google results on the question.  I'll read up on xACT right away.  Even if it's much more difficult to use than XLD, just the ability to confirm conversions is worth the hassle.  If a guy is going to convert an entire collection - and especially if he wants to erase the source files afterwards - confirming the transcode is mandatory. 

Either that or I suck it up and buy two more hard drives (one for ALAC collection, another for backup) so that my FLACs remain in the house if something goes wrong.  That's a lot of extra $$, but this is an important (to me) music collection we're talking about. 

Help converting FLAC/APE files to ALAC on a Mac

Reply #16
So what you have is single-file per album with cue-sheets embedded flacs now?
If yes, then is there a sample like that online? (I can probably bash something up, if it's not too hard).
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #17
So what you have is single-file per album with cue-sheets embedded flacs now?


I have single file FLACs with CUE, multi-track FLACs with CUE, as well as APE with CUE.  I don't know what 'embedded' means.  The CUEs are always a separate file in the album folder.

Help converting FLAC/APE files to ALAC on a Mac

Reply #18
Then they aren't embedded, unless they somehow managed to find their way into a tag as well.

PS: I edited my earlier posts to include the case of single-file images.  The only reason was to reassure you that the conversion process will still not affect the sub-channel information in a cue sheet.

Help converting FLAC/APE files to ALAC on a Mac

Reply #19
So basically cue-sheets stay as they were or do we want splitted tracks (based on this cue-sheets)?

edit: actually forget that, you have tools online (google) that will split flac to flacs, based on cue sheet. I'll try to do some work on audio verification (verifiying decoded alac vs decoded flac, based on md5sum) and will not deal with cue-sheets at all.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #20
ok, so this will take only files as input currently (and only with .flac extension), what it does;

a. Uses ffmpeg to convert to ALAC
b. calculates FLAC raw audio crc
c. calculates ALAC raw audio crc
d. compares b. and c., says ok, or says error

Relevant part of sh looks like;

Code: [Select]
for files in "$@" ;do
# check if it is a file
if [[ -f $files ]]; then
echo "$files"
if [[ $files == *.flac ]]; then

out="$files"

# ffmpeg command:
./ffmpeg -loglevel warning -i "$files" -acodec alac -vn "$out.m4a"

# echo "original md5"
origcrc=$(./ffmpeg -loglevel warning -i "$files" -f crc -)

# echo "alac md5"
alaccrc=$(./ffmpeg -loglevel warning -i "$out.m4a" -f crc -)

if [ "$origcrc" == "$alaccrc" ]
then
echo "crc ok" "$origcrc"
else
echo "crc error"
say "crc error"
fi

else
echo "not a flac extension"
fi
 
else
echo "not a file" 
   
fi

done

download (it's a droplet);
https://dl.dropboxusercontent.com/u/7953236...ToALACcheck.zip
(only slightly tested and only on Mavericks, should work on Mountain Lion as well thought ...)
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #21
There's no need to calculate the hash for the flac, it's already stored in the file.

metaflac --show-md5sum

I guess the OP has some Monkey's Audio to deal with as well.

Help converting FLAC/APE files to ALAC on a Mac

Reply #22
@greynol
a. The app could be easily extended to take any FFMPEG supported audio input
b. FFMPEG has a built in crc calc format, so md5 is not that usefull
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #23
Why waste cycles decoding a flac file in order to get information that is already stored in it?

Perhaps I don't understand what your script is actually doing.

Here's a portion of my code as an example of how I verified a flac conversion to tak 2.2.0 in a windows batch file:
Code: [Select]
:encode_from_flac
flac.exe -dcs %1 | takc.exe -e -p0 -ihs -sts3 - "%~dpn1.tak"
IF %errorlevel% NEQ 0 GOTO error
FOR /F "usebackq" %%X IN (`metaflac.exe --show-md5sum %1`) DO SET md5flac=%%X
FOR /F "usebackq" %%X IN (`takc.exe -d "%~dpn1.tak" - ^| sox.exe -t wav - -t raw - ^| md5sum.exe`) DO SET md5tak=%%X
IF %md5flac% NEQ %md5tak% ECHO Fail && GOTO error
GOTO :eof

Help converting FLAC/APE files to ALAC on a Mac

Reply #24
Like i said, the input could be more than just FLAC in the near future, also ALAC doesn't seem to carry md5sum info and we have native crc format allready provided inside the FFMPEG. Perhaps I'am not sure what part you don't understand.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung