PLAY (CD Audio Commands)
Appearance
The PLAY command starts playing audio from the CD device. It allows for specific range playback by defining start and end points within the media.
Syntax
PLAY ─── object ──┬────────────┬──┬──────────┬──┬──────────┬───┤
└─ FROM pos ─┘ └─ TO pos ─┘ ├─ WAIT ─┤
└─ NOTIFY ─┘
Keywords
- object
- Object associated with this media control interface command (Device type, name, filename, or alias).
- FROM pos
- Specifies the position at which to start playback. If this keyword is omitted, playback begins at the current position. An error is returned if the start position is beyond the end of the disc or the specified **TO** position.
- TO pos
- Specifies the position at which to stop playback. If this keyword is omitted, playback continues until the end of the disc. If the position is beyond the disc's total length, an **OUT OF RANGE** error is returned.
- WAIT
- Executes the command synchronously. The function waits until the playback is finished (or interrupted) before returning control to the application.
- NOTIFY
- Executes the command asynchronously. The device begins playing immediately, and an MM_MCINOTIFY message is sent to the application window procedure once the operation (reaching the stop point or the end of the disc) is complete.
Purpose
The PLAY command is the primary method for initiating audio output. By combining the **FROM** and **TO** keywords, applications can play specific tracks or segments of audio based on the current time format (e.g., milliseconds or Redbook tracks).
Example
play cdaudio from 10000 to 30000 wait *(Plays the audio segment starting at 10,000 units and ending at 30,000 units, waiting for completion)*