PlayMedia

Controls multimedia devices.

Syntax:

PlayMedia (mci-string)

Parameters:

(s) mci-string string to be sent to the multimedia device.

Returns:

(s)  response from the device.

 

If the appropriate Windows multimedia extensions are present, this function can control multimedia devices. Valid command strings depend on the multimedia devices and drivers installed. The basic Windows multimedia package has a waveform device to play and record waveforms, and a sequencer device to play MIDI files. Refer to the appropriate documentation for information on command strings.

Many multimedia devices accept the WAIT or NOTIFY parameters as part of the command string:

WAIT Causes the system to stop processing input until the requested operation is complete. You cannot switch tasks when WAIT is specified.

NOTIFY Causes the WIL program to suspend execution until the requested operation completes. You can perform other tasks and switch between tasks when NOTIFY is specified.

WAIT NOTIFY Same as WAIT.

 

If neither WAIT nor NOTIFY is specified, the multimedia operation is started and control returns immediately to the WIL program.

In general, if you simply want the WIL program to wait until the multimedia operation is complete, use the NOTIFY keyword. If you want the system to hang until the operation is complete, use WAIT. If you just want to start a multimedia operation and have the program continue processing, don't use either keyword.

The return value from PlayMedia is whatever string the driver returns. This will depend on the particular driver, as well as on the type of operation performed.

Example:


; Plays a music CD on a CDAudio
; drive, from start to finish
stat = PlayMedia("status cdaudio mode")
answer = 1
If stat == "playing"
   answer = AskYesNo("CD Audio", "CD is Playing. Stop?")
   If answer == 0 Then Exit
EndIf
PlayMedia("open cdaudio shareable alias donna notify")
PlayMedia("set donna time format tmsf")
PlayMedia("play donna from 1")
PlayMedia("close donna")
Exit
:CANCEL
PlayMedia("set cdaudio door open")
See Also:

Beep, PlayMidi, PlayWaveForm, Sounds