Most applications recognize audio from a multimedia wave-in driver. Microsoft provides a component object called the multimedia audio-source object that provides access to the multimedia wave-in driver. To use the multimedia audio-source object, an application calls the CoCreateInstance function with the CLSID_MMAudioSource class identifier. The function returns the address of the IUnknown interface supported by the audio-source object. The application needs to specify this address when creating an engine object (described later in this section).
By default, the multimedia audio-source object uses WAVE_MAPPER as the audio device. To use a different device, the application can call the IUnknown::QueryInterface member function with the IID_IAudioMultiMediaDevice interface identifier. QueryInterface returns the address of the IAudioMultimediaDevice interface. The application can then call the IAudioMultimediaDevice::DeviceNumSet member function to set the identifier of the multimedia device to use as the audio source.
An application can retrieve a list of wave-in audio devices available in the system by using the WaveInGetNumDevs and WaveInGetDevCaps functions.
After acquiring the address of the IAudioMultimediaDevice interface, an application must call the Release member function before it closes to release the audio-source object.
As an alternative to using an engine object and multimedia audio-source object, an application can use the speech-recognition sharing object to use an engine and an audio source that are shared with other applications. For more information about the speech-recognition sharing object, see "Speech-Recognition Sharing Object" later in this section.