11.1.73    <MCISEND>


Description:   Sends an MCI command string to multimedia devices including waveaudio, Voice, MIDI, and Video. Downloads MCI file to client  if not found in local client project directory.

Syntax:         <MCISEND>mc_ command device arguments


Argument:     MCI command string, no space before command, spaces allowed as part of the command string.


See Also:       Screen script MCISEND


Examples:      example 1 - two buttons

Button 1 -  open thank you wave file

<MCISEND>open thankyou.wav type WaveAudio alias wave wait

Button 2 -  play thank you wave file

<MCISEND>play wave from 1


example 2 - two buttons

button 1 - open clap wave and play it

<MCISEND>open waveaudio!clap.wav alias wave wait

button 2 - play clap

<MCISEND>play wave from 1


example 3 - open and play a MIDI file

<MCISEND>open applause.mid type sequencer alias midi wait

<MCISEND>play midi


example 4 - close open file

<MCISEND>close wave

Sends an MCI command string to multimedia devices including waveaudio, Voice, MIDI, and Video.  The MCI files should be located in project root directory (not bgr).  The recommended location is:

Media Files requested by the "open" command  will be downloaded to the client if it does not exist in the local client project directory.  The Media file must have a file extension in order for the parser to determine it is a file. (A dot or period is needed by the parser to distinguish the media file name). The source file must be in the project root directory of the SCADA node.

WARNING - large media files can require long time to download and can effectively lock-up your client while the download takes place. Be careful of using large media files.

Device Driver must be installed on Client

The client must have the appropriate Media Player device driver installed.  WebAccess is only sending a command to the media player (and will download the media data file).  For example, to play a sound wave file (*.wav), a sound card and speaker(s) must be installed on the client computer.  WebAccess will not use the default speaker to play wave files (unless the waveaudio driver installed on the client supports it).  Similarly, WebAccess will not play MIDI sounds (*.mid) unless a MIDI sequencer and speaker(s) are installed on the client .  Some example device drivers are:

  cdaudio		MCICDA.DRV
  sequencer	MCISEQ.DRV
  videodisc	MCIPIONR
		waveaudio	MCIWAVE.DRV


Device names supported by MCI command

There are several device types that are supported in the MCI standard. The devices are


cdaudio                   - CD Audio player

dat                        - Digital audio tape player

digitalvideo    - Digital video in a window, not GDI based

MMMovie       - Multimedia Movie Player

other                      - Undefined MCI device

overlay                   - Overlay device e.g. analogue video in a window

scanner                  - Image scanner

sequencer      - MIDI sequencer

vcr               - Videotape player or recorder

videodisc       - Videodisc player

waveaudio             - Audio device that plays digitized waveform files e.g. soundblaster card.

Example of MCI commands.

A device needs to be opened before it will accept any other commands and it must be closed after you have finished with it.  With some devices it is necessary to stop the device before closing it e.g. with authorware you can close the cdaudio and will continue to play unless you stop it from playing first.
A typical use of MCI in a program will have lines similar to the following

<MCISEND> open cdaudio
<MCISEND> play cdaudio
<MCISEND> stop cdaudio
<MCISEND>close cdaudio

Obviously there is a need to have a pause between the first two and the last two commands here!  If the stop command or close command is issued immediately after the play command, nothing happens.  It is possible to give a device an alias in the open command string and then use this alias in all the other commands e.g.

 <MCISEND>open applause.wav type WaveAudio alias wave wait

		<MCISEND>play wave
The wait flag

Normally MCI functions return control to the user immediately, even if the command takes several minutes to complete the action e.g. a tape starts to rewind but control is returned before the rewinding finishes which continues in the background. Adding the option wait to a command string tells MCI to wait until the requested action is complete e.g.


<MCISend>play z wait

will play the whole CD before returning control to the application.

Using all as a device name

It is possible to use all as the device name for any command that does not return data. The most common use would probably be:

<MCISend>close all

The <MCISEND> keymacro will interact with the MCISEND action command used in screen scripts.


See also %TMCIERROR, MCISEND, <MCISEND>,  Play a wav file  catch and display errors.