MCITEST: Records and Plays Script Files

MCITEST shows how to record and play script files with media control interface (MCI) functions and command strings. It demonstrates how you can use the MCI command string syntax described in the Microsoft(R) Windows(TM) version 3.1 Software Development Kit (SDK) "Multimedia Programmer's Reference" manual, Appendix A.

To use MCITEST, place the cursor in the large multiline text box in the main window and type:

open c:\mmdata\bells.wav type WaveAudio alias test

where c:\mmdata\bells.wav is the full path of the WAV file you want play. The MCI Output box displays "1" and the Error box indicates whether the function was successful. Now type:

play test

to play the sound. If it does not play, your sound card may be set up incorrectly. After you are done, type:

close test

to close the file.

The main window also contains a Notification section that displays information if you append the keyword "status" to a command. Choose Devices from the menu bar and move the Open MCI Devices dialog box so it does not overlap other windows. In the multiline text box, type:

open WaveAudio notify

WaveAudio is now listed in the Open MCI Devices dialog box, and an option button is selected under Notification, based on the return value of the function (the Successful button should be selected).

Now type:

close WaveAudio notify

The Devices dialog is now empty, and the Successful button is selected under Notification. The Superseded button is set if another wave file is started before the current file completes execution. The Aborted button is set if a function is canceled before completion.

You can use the File Save command to save your script and File Open to play the script another time with the Go and Step buttons. For more information, see the Microsoft Windows SDK "Multimedia Programmer's Reference" manual.

MCITEST was built and tested under Microsoft Windows version 3.1.

{ewc navigate.dll, ewbutton, /Bcodeview /T"Click to open or copy files in the mcitest project." /C"samples}