Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpAudio

Objects that implement 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 multimedia device. It is expected to supply an infinite amount of data and hence its state should not change externally. Typically, applications will not need 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 multimedia device allowing the use of the multimedia audio objects provided by the Speech Platform.

In order to prevent multiple TTS voices or engines from speaking simultaneously, the Speech Platform 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

  • SpMMAudioIn
  • SpMMAudioOut

Methods in Vtable Order

Value Description
ISpStreamFormat interface Inherits from ISpStreamFormat and all those methods are accessible from an ISpAudio object.
SetState Sets the state of the audio device.
SetFormat Sets the format of the audio device.
GetStatus Passes back the status of the audio device.
SetBufferInfo Sets the audio stream buffer information.
GetBufferInfo Passes back the audio stream buffer information.
GetDefaultFormat Passes back the default audio format.
EventHandle Returns a Win32 event handle that applications can use to wait for status changes in the I/O stream.
GetVolumeLevel Passes back the current volume level.
SetVolumeLevel Sets the current volume level.
GetBufferNotifySize Retrieves the audio stream buffer size information.
SetBufferNotifySize Sets the audio stream buffer size information.

Development Helpers

Enumeration, Function, or Class Description
SPSTREAMFORMAT Stream formats supported by the Speech Platform.
CSpStreamFormat Class for managing stream formats and WAVEFORMATEX structures supported by the Speech Platform.