In addition to querying the capabilities of a device, you can use the waveOutOpen or waveInOpen functions to open a waveform audio I/O device for recording or playback. These functions open the device associated with the specified device identifier and return a pointer to an open device handle.
Both waveOutOpen and waveInOpen choose the device best able to play the specified data format. The Windows CE OS identifies waveform audio I/O devices by using a device identifier. The OS determines the device identifier implicitly from the number of devices present in a system. Device identifiers range from zero through the number of devices present, minus one. For example, the valid device identifiers for a system with two waveform audio output devices are 0 and 1.
In addition to the device number, the waveOutOpen and waveInOpen functions require a pointer to a memory location. The functions fill the memory location with a device handle. Use this device handle to identify the open waveform audio I/O device when calling other audio functions. The following list describes the differences between a device identifier and a device handle: