CDreadda - read digital audio data from audio CD in CD-ROM
int CDreadda(CDPLAYER* cd, CDFRAME* buf, int numframes)
cd A pointer to the CDPLAYER structure representing the target
buf A pointer to a buffer in which to put the data.
numframe The number of frames of digital audio data to read.
If successful, this function returns the number of frames read (a
nonnegative integer value). Otherwise -1 is returned and errno is set to
indicated the error. A return value of 0 indicates the logical read
pointer has reached the end of the audio CD data.
CDreadda(3dm) reads numframes frames [see cdframe (4)] of digital audio
data from an audio CD mounted in the CD-ROM drive. The digital audio
data stream contains 75 frames every second. A file pointer is
maintained which points at the starting location for the read. CDopen
initializes the file pointer to 0. On successful completion CDreadda
sets the pointer to the end of the requested data. The pointer may be
set to any random location with CDseek.
CDopen sets the CD-ROM drive read-ahead buffer parameters to values
carefully chosen to allow continuous reading of audio data without
interruption. To keep up with this data transfer and maintain an
uninterrupted audio stream, numframes must be twelve.
CDreadda will fail and no data will be returned if one of more of the
following are true:
[EAGAIN] The CD-ROM status is not STA_GOOD.
[EBADF] The specified CDPLAYER is not valid.
[EIO] An error occurred during the read operation.
[ENXIO] The specified CD-ROM drive does not support this
CDintro(3dm), CDclose(3dm), CDgetstatus(3dm), CDgettrackinfo(3dm),
CDeject(3dm), CDframetomsf(3dm), CDframetotc(3dm), CDmsftoframe(3dm),
CDopen(3dm), CDparseframe(3dm), CDseek(3dm), CDseekblock(3dm),
PPPPaaaaggggeeee 2222 [ Back ]