The CD audio command set provides a common method for playing CD audio in the Windows environment. This device type includes the MCICDA.DRV device driver which operates with any CD-ROM device supporting the audio services of MSCDEX. CD audio devices support the following set of commands:
CD Audio Commands
Command | Description |
capability item | Requests information about the capabilities of the CD audio device. One of the following items is required: |
can eject Returns true if the CD audio device can eject the media. | |
can play Returns true if the CD audio device can play the media. | |
can record Returns false. CD audio devices cannot record. | |
can save Returns false. CD audio devices cannot save data. | |
compound device Returns false. CD audio devices are simple devices. | |
device type Returns CD audio. | |
has audio Returns true. | |
has video Returns false. CD audio devices do not support video. | |
uses files Returns false. Simple devices do not use files. | |
close | Closes the device. |
info item | Fills a user-supplied buffer with information. One of the following optional items modifies info: |
product Returns the product name and model of the current audio device. The MCICDA device driver returns CD Audio Player. | |
open items | Initializes the device. MCI reserves cdaudio for the compact disc audio device type. The following optional items modify open: |
alias device_ alias Specifies an alternate name for the given device. If specified, it must also be used for subsequent references. | |
shareable Initializes the device as shareable. Subsequent attempts to open it fail unless you specify shareable in both the original and subsequent open commands. MCI returns an error if it is already open and not shareable. | |
pause | Pauses playing. This is the same as the stop command for the MCICDA device driver. |
play items | Starts playing audio. The following optional items modify play: |
from position to position Specifies the position to start and stop playing. If from is omitted, the play starts at the current position; if to is omitted, play stops at the end of the disc. If the from position is greater than the end position of the disc, or if the from position is greater than the to position, MCI returns an error. If the to position is greater than the length of the disc, MCI returns an error. | |
resume | Resumes playing of a paused device. The MCICDA device driver does not support this option. |
seek item | Moves to the specified location on the disc. If already playing or recording, the device stops. One of the following optional items modifies seek: |
to position Specifies the destination position for the seek. If it is greater than the length of disc, MCI returns an out-of-range error. | |
to start Specifies seek to the start of the audio data on the disc. | |
to end Specifies seek to the end of the audio data on the disc. | |
set items | Sets the various control items: |
audio all off, audio all on Enables or disables audio output. | |
audio left off, audio left on Enables or disables output to the left audio channel. | |
audio right off, audio right on Enables or disables output to the right audio channel. | |
door closed Retracts the tray and closes the door if possible. | |
door open Opens the door and ejects the tray if possible. | |
time format milliseconds Sets the time format to milliseconds. All position information is in this format after this command. You can abbreviate milliseconds as ms. | |
time format msf Sets the time format to minutes, seconds, and frames. When time or position values are used, they are expressed as mm:ss:ff, where mm is minutes, ss is seconds, and ff is frames. This is the default format for CD audio. On input, ff can be omitted if 0, and ss can be omitted if both it and ff are 0. For example, 3, 3:0, and 3:0:0 are valid ways to express 3 minutes. These fields have the following maximum values: Minutes 99 Seconds 59 Frames 74 | |
time format tmsf Sets the time format to tracks, minutes, seconds, and frames. When time or position values are used, they are expressed as tt:mm:ss:ff, where tt is tracks, mm is minutes, ss is seconds, and ff is frames. All position information is in this format after this command. On input, ff can be omitted if 0, ss can be omitted if both it and ff are 0, and mm can be omitted if it, ss, and ff are 0. For example, 3, 3:0, 3:0:0, 3:0:0:0 all specify track 3. These fields have the following maximum values: Tracks 99 Minutes 99 Seconds 59 Frames 74 | |
status item | Obtains status information for the device. One of the following items modifies status: |
current track Returns the current track. | |
length Returns the total length of the disc. | |
length track track_number Returns the length of the track specified by track_number. | |
media present Returns true if the disc is inserted in the drive; otherwise it returns false. | |
mode Returns not ready, open, paused, playing, seeking, or stopped for the current mode of the device. | |
number of tracks Returns the number of tracks on the disc. | |
position Returns the current position. | |
position track track_no Returns the starting position of the track specified by track_no. | |
ready Returns true if the device is ready. | |
start position Returns the starting position of the disc or device element. | |
time format Returns the current time format. | |
stop | Stops playing. |