Hi, this is a small python script which converts all ALAC (Apple Lossless Audio Codec) files into Flac. ALAC is Apple's proprietary version of a lossless codec, and while not containing any DRM in itself, it can be (and usually is) packaged in an mp4 container (which would theoretcially allow for DRM). For more information I recommend the Wikipedia Entry on the subject.
Thanks to a certain David Hammerton, we have an open source ALAC decoder (written in C) which we can use to decode the files. I wrote a script which takes all the ALAC files in the current folder, and converts them to FLAC files (in a destination directory of your choice).
The script is very simple, there is still a bit of work to do. One thing to note is that the script checks for .m4a files and tries to decode them. It does not check to see whether or not the files are ALAC. Also if the ALAC files are not ending with the extension .m4a, they will be ignored. If your ALAC files end with something else, then you will have to change the script by hand.
Also, there currently is no support for the writing of tags. This is because the ALAC decoder does not support reading of tags. I am guessing that the actual container has the tags, so I would need a mp4 tag reader to be able to get tags out of ALAC files (todo).
You can find the script here.
Usage: Run "alac_2_FLAC.py -h" to get a list of available options.