Waveform Audio Commands

Waveform audio drivers must support the following set of commands:

Waveform Audio Commands

Command Description

capability item Requests information about the capabilities of the waveform audio driver. One of the following items modify capability:
  can eject Returns false. Waveform audio devices have no media to eject.
  can play Returns true if the device can play. The waveform audio device returns true if an output device is available.
  can record Returns true if the device can record.
  can save Returns true if the waveform audio device can save data.
  compound device Returns true; waveform audio devices are compound devices.
  device type Returns waveaudio.
  has audio Returns true.
  has video Returns false. Waveform audio devices do not support video.
  inputs Returns the total number of input devices.
  outputs Returns the total number of output devices.
  uses files Returns true. Waveform audio devices use files for operation.
close Closes the device element and any resources associated with it.
cue item Prepares for playing or recording. The cue command does not have to be issued prior to playing or recording. However, depending on the device, it might reduce the delay associated with the play or record command. This command fails if playing or recording is in progress. The item is one of the following:
  input Prepares for recording.
  output Prepares for playing. This is the default.
delete items Deletes a data segment from the MCI element. The following optional items modify cut:
  from position to position Specifies the positions to start and stop deleting data. If from is omitted, deletion starts at the current position; if to is omitted, deletion stops at the end of the file or waveform.
info item Fills a user-supplied buffer with information. One of the following items modifies info:
  input Returns the description of the current waveform audio input device. Returns none if an input device is not set. The MCIWAVE driver returns Wave Audio Input and Output Device.
  file Returns the current filename.
  output Returns the description of the current waveform audio output device. Returns none if an output device is not set. The MCIWAVE driver returns Wave Audio Input and Output Device.
  product Returns the description of the current waveform audio output device. The MCIWAVE driver returns Wave Audio Input and Output Device.
open items Initializes the device. The following items are optional:
  alias device_ alias Specifies an alternate name for the given device. If specified, it must also be used the alias for references.
  buffer buffer_ size Sets the size in seconds of the buffer used by the waveform audio device. The default size of the buffer is set when the waveform audio device is installed or configured. Typically the buffer size is set to 4 seconds.
  shareable Initializes the device element 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. The MCIWAVE device does not support shared files.
  type device_ type Specifies the device type of a device element. MCI reserves waveaudio for the waveform audio device type. As an alternative to type, MCI can use the [mci extension] entries in the SYSTEM.INI file to select the controlling device based on the extension used by the device element.
pause Pauses playing or recording.
play items Starts playing audio. The following optional items modify play:
  from position to position Specifies the positions to start and stop playing. If from is omitted, play starts at the current position; if to is omitted, play stops at the end of the file or waveform.
record items Starts recording audio. All data recorded after a file is opened is discarded if the file is closed without saving it. The following optional items modify record:
  insert Specifies that new data is added to the device element.
  from position to position Specifies the positions to start and stop recording. If from is omitted, the device starts recording at the current position; if to is omitted, the device records until a stop or pause command is received.
  overwrite Specifies that new data will replace data in the device element. The MCIWAVE driver does not support this option.
,  
resume Resumes playing or recording of a paused device.
save item Saves the MCI element in its current format. The following item modifies save:
  filename Specifies the file and pathname used to save data.
seek item Moves to the specified location in the file. One of the following items modify seek:
  to position Specifies the stop position.
  to start Specifies to seek to the start of the first sample.
  to end Specifies to seek to the end of the last sample.
set items Sets the various control items:
  alignment integer Sets the alignment of data blocks relative to the start of waveform data passed to the waveform audio device. The file is saved in this format.
  any input Use any input that supports the current format when recording. This is the default.
  any output Use any output that supports the current format when playing. This is the default.
  audio all off, audio all on Enables or disables audio output. The MCIWAVE driver does not support this option.
  audio left off, audio left on Enables or disables output to the left audio channel. The MCIWAVE driver does not support this option.
  audio right off, audio right on Enables or disables output to the right audio channel. The MCIWAVE driver does not support this option.
  bitspersample bit_count Sets the number of bits per sample played or recorded. The file is saved in this format.
  bytespersec byte_rate Sets the average number of bytes per second played or recorded. The file is saved in this format.
  channels channel_count Sets the channels for playing and recording. The file is saved in this format.
  format tag tag Sets the format type for playing and recording. The file is saved in this format.
  format tag pcm Sets the format type to PCM for playing and recording. The file is saved in this format.
  input integer Sets the audio channel used as the input.
  output integer Sets the audio channel used as the output.
  samplespersec integer Sets the sample rate for playing and recording. The file is saved in this format.
  time format bytes Sets the time format to bytes. All position information is specified as bytes following this command.
  time format milliseconds Sets the time format to milliseconds. All position information is specified as milliseconds following this command. This is the default. You can abbreviate milliseconds as ms.
  time format samples Sets the time format to samples. All position information is specified as samples following this command.
status item Obtains status information for the device. One of the following items modifies status:
  alignment Returns the block alignment of data in bytes.
  bitspersample Returns the bits per sample.
  bytespersec Returns the average number of bytes per second played or recorded.
  channels Returns the number of channels set (1 for mono, 2 for stereo).
  current track Returns the index for the current track. The MCIWAVE device returns 1.
  format tag Returns the format tag.
  input Returns the input set. If one is not set, the error returned indicates that any device can be used.
  length Returns the total length of the waveform.
  length track track_number Returns the length of the specified track.
  level Returns the current audio sample value.
  media present Returns true.
  mode Returns not ready, paused, playing, stopped, recording, or seeking for the device mode.
  number of tracks Returns the number of tracks. The MCIWAVE device returns 1.
  output Returns the currently set output. If no output is set, the error returned indicates that any device can be used.
  position Returns the current position.
  position track track_number Returns the position of the track specified by track_number. The MCIWAVE device returns 0.
  ready Returns true if the device is ready.
  samplespersec Returns the number of samples per second played or recorded.
  start position Returns the starting position of the media or device element.
  time format Returns the current time format.
stop Stops playing or recording.