Partager via


ISpAudio (SAPI 5.3)

Microsoft Speech API 5.3

ISpAudio

Objects implementing this interface are real-time audio streams, such as those connected to a live microphone or telephone line. ISpAudio methods support of control of real-time audio streams. IStream Read and Write methods transfer data to or from an object.

When to Implement

This interface should be implemented when the audio input or output source is not a standard windows Multimedia device. It is expected to supply an infinite amount of data and hence its state should not change externally to SAPI. For the majority of users, it will not be necessary to implement an object providing this interface. An example of where this might be needed would be to provide a telephony audio device or to perform echo cancellation of audio output on the input.

Telephone application programming interface (TAPI) provides a mechanism to treat a telephony device as a Windows multimedia device allowing the use of the SAPI provided multimedia audio objects.

If this implements a real time audio input or output object and runs in a desktop or graphical environment, support may be needed for volume (see SPDUI_AudioVolume) and audio properties (see SPDUI_AudioProperties) UI. The preferred method for SAPI to implement the UI is to have the object inherit from ISpTokenUI. This will enable applications (including Speech properties in Control Panel) to display the UI in a simple and consistent manner.

In order to prevent multiple TTS voices or engines from speaking simultaneously, SAPI serializes output to objects which implement the ISpAudio interface. To disable serialization of outputs to an ISpAudio object, place an attribute called "NoSerializeAccess" in the Attributes folder of its object token.

Implemented By

Methods in Vtable Order

Value
ISpStreamFormat interface
SetState
SetFormat
GetStatus
SetBufferInfo
GetBufferInfo
GetDefaultFormat
EventHandle
GetVolumeLevel
SetVolumeLevel
GetBufferNotifySize
SetBufferNotifySize

Development Helpers

Helper Enumerations, Functions and Classes
SPSTREAMFORMAT
CSpStreamFormat