77.1.5 Opening MCI Devices

Before using an MCI device, you must initialize it by opening it. Opening a device loads its driver into memory (if it isn't already loaded), and establishes a device ID to identify the device in subsequent commands. (The device ID is not used in the command-string interface.) There are several ways to specify which device you want to open:

With simple devices, you can open the device by specifying the device name.

With compound devices, you can open the device by specifying the device name, the device element, or both.

For example, the following command string opens a CD audio device (a simple device) by specifying the device name:

open cdaudio

The next command string opens a waveform audio device (a compound device) by specifying the device name and a device element:

open bells.wav type waveaudio

You can also open a compound device by specifying only the device element as shown in the following example:

open bells.wav

If you specify only a device element when opening a compound device, MCI uses the file extension of the device element filename to determine which device to open. The WIN.INI file contains an [mci extensions] section that associates file extensions and corresponding MCI device types. The following is part of an [mci extensions] section:

[mci extensions]

wav=waveaudio

mid=sequencer

rmi=sequencer