This article is from the CD-Recordable FAQ, by Andy McFadden (firstname.lastname@example.org) with numerous contributions by others.
Source code and ready-to-link libraries are available, but the more useful
products tend to be more expensive. The library authors are usually CD-R
software publishers themselves, and aren't about to put themselves out of
business. Expect to sign a strict licensing agreement, if they agree to
do business at all.
Source code for some of the packages (notably Joerg Schilling's "CD Record"
and "CD Tools" by Dieter Baron and Armin Obersteiner) is available. See
sections (6-1-20) and (6-1-23).
ASPI developer documentation and SDKs used to be available from
http://www.adaptec.com/adaptec/developers/, but seems to have vanished.
See http://www.hochfeiler.it/alvise/ASPI_1.HTM for an introduction, and
ftp://ftp.adaptec.com/obsolete/adaptec/aspi_w32.txt for what's left of
the Adaptec documentation.
Visit http://www.hochfeiler.it/alvise/cd-r.htm for a nice introduction
to controlling a CD recorder.
The basic idea is to issue SCSI commands directly to the drive, via some
standard interface. Windows has ASPI (courtesy Adaptec), WinNT and later
have SPTI, and other platforms have their own approaches. ASPI is well
documented (though you have to search for the docs), SPTI is not (but
it's very straightforward, and some sample code exists). Descriptions of
the SCSI commands can be found in the SCSI-2 and MMC specifications at
ftp://ftp.t10.org/t10/, e.g. ftp://ftp.t10.org/t10/drafts/mmc2/mmc2r10.pdf,
Some nice samples can be found here: