3

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.

Zaheer Ahmed
  • 28,160
  • 11
  • 74
  • 110
Adion
  • 579
  • 1
  • 9
  • 21
  • 1
    For what it's worth, you've effectively described burning a playlist to disc in iTunes. – Austin Salonen Oct 13 '09 at 20:46
  • 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 Oct 13 '09 at 21:05

2 Answers2

12

Command:

drutil burn -audio /path/to/folder
halfer
  • 19,824
  • 17
  • 99
  • 186
Kcid Kcus
  • 121
  • 1
  • 2
  • This should have been posted as a comment to [this answer](http://stackoverflow.com/a/1562822/3903832). – Yoel Dec 13 '14 at 23:20
  • 1
    This *does* provide an answer to the quetsion, and it is certainly *not* a comment. – user207421 Dec 14 '14 at 00:57
  • This doesn't seem to add much to the [answer posted above](http://stackoverflow.com/a/1562822/3903832). 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 Dec 14 '14 at 06:41
  • This even works on a mid 2009 MacBookPro that has been unofficially updated to Mojave and since then lacks finder/iTunes disk burning support. – Thomas Dec 17 '20 at 00:21
4

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

Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • 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 http://developer.apple.com/mac/library/samplecode/AudioBurn/index.html – Adion Nov 03 '09 at 17:53
  • 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 Feb 26 '14 at 14:17
  • If you have trouble with drutil not burning the files in alphabetical order, check your source drive type. When burning from a flash drive the file order was incorrect but it worked correctly when the files were copied to disk and burned from it. – eric gilbertson Mar 01 '23 at 00:01