Connecting Directly to Audio Hardware

An existing engine may connect directly to audio hardware, usually to a circuit board with a hardware assist. If necessary, an engine can connect directly to the hardware and still be ported to the speech API. Be aware, however, that the engine will work only with applications specifically designed to cooperate with that engine, which limits the usefulness of the engine.

To enable an engine to connect directly to audio hardware:

1. Create a custom OLE interface — for example, ICustom — that provides direct control of the hardware.

2. Provide a custom OLE object — for example, "custom audio source" — that supports the ICustom interface.

To enable an application to recognize audio directly from the hardware:

1. Create an instance of the custom audio-source object and pass the instance to the engine.

2. When the application passes a pointer to an IUnknown interface to the engine, the engine calls the IUnknown::QueryInterface member function for the ICustom interface.

3. If the ICustom interface is found, the engine uses ICustom to control and configure the hardware.

4. If the ICustom interface is not found, the engine uses the digital-audio data supplied by the IAudio and IAudioSource interfaces.