How to burn an Audio CD programmatically in Mac OS X

All the info I can find about burning cd's is for Windows, or about full programs to burn cd's. I would however like to be able to burn an Audio CD directly from within my program.

I don't mind using Cocoa or Carbon, or if there are no API's available to do this directly, using a command-line program that can use a wav/aiff file as input would be a possibility too if it can be distributed with my application.

Because it will be used to burn dj mixes to cd, it would also be great if it is possible to create different tracks without a gap between them.

13.10.2009 20:41:40
For what it's worth, you've effectively described burning a playlist to disc in iTunes.
Austin Salonen 13.10.2009 20:46:48
That's true and you should be able to automate that process using iTunes Apple Event scripting, i.e. AppleScript or Appscript in python or ruby.
Ned Deily 13.10.2009 21:05:30
2 ОТВЕТА
РЕШЕНИЕ

Check out the Apple-supplied drutil command. If you need more flexibility, the DiscRecording Framework is documented here.

3
13.10.2009 20:50:58
Thanks, it looks like the DiscRecording FrameWorking will do what I need. I also found a simple example on how to use it together with the DiscRecordingUI framework, and that looks really easy to use. For those that want to try the example, it looks like it was written for PowerPC, so you'll have to change the AIFF reader to swap the UInt32's around in order to make it work on x86 developer.apple.com/mac/library/samplecode/AudioBurn/index.html
Adion 3.11.2009 17:53:26
Can you provide snipped code for swapping AIFF reader? uint32 byteSize = (fileInfo.dataEnd - fileInfo.dataStart) / (fileInfo.sampleBytes * fileInfo.numChannels) * 4; return [DRMSF msfWithFrames:byteSize / 2352];
sundsx 26.02.2014 14:17:19

Command:

drutil burn -audio /path/to/folder
10
13.12.2014 23:46:05
This should have been posted as a comment to this answer.
Yoel 13.12.2014 23:20:20
This does provide an answer to the quetsion, and it is certainly not a comment.
user207421 14.12.2014 00:57:23
This doesn't seem to add much to the answer posted above. Specifically, the drutil is already mentioned in that answer and therefore I believe this would have been more suitable as a comment to that answer.
Yoel 14.12.2014 06:41:34