ISpVoice (SAPI 5.4)

Speech API 5.4
Microsoft Speech API 5.4


The ISpVoice interface enables an application to perform text synthesis operations. Applications can speak text strings and text files, or play audio files through this interface. All of these can be done synchronously or asynchronously.

Applications can choose a specific TTS voice using ISpVoice::SetVoice. The state of the voice (for example, rate, pitch, and volume), can be modified using SAPI XML tags that are embedded into the spoken text. Some attributes, like rate and volume, can be changed in real time using ISpVoice::SetRate and ISpVoice::SetVolume. Voices can be set to different priorities using ISpVoice::SetPriority.

ISpVoice inherits from the ISpEventSource interface. An ISpVoice object forwards events back to the application when the corresponding audio data has been rendered to the output device.

Associated Class IDs

The following class IDs (CLSID) may be used with this interface. A complete CLSID listing for all interfaces is in the Class IDs section.


Methods in Vtable Order

ISpVoice MethodsDescription
ISpEventSource inherited methodsAll methods of ISpEventSource are accessible from this interface
SetOutputSets the current output object. A value of NULL may be used to select the default audio device.
GetOutputObjectTokenRetrieves the object token for the current audio output object.
GetOutputStreamRetrieves a pointer to the current output stream.
PausePauses the voice at the nearest alert boundary and closes the output device.
ResumeSets the output device to the RUN state and resumes rendering.
SetVoiceSets the identity of the voice used for text synthesis. By default, ISpVoice will use the voice information set in Speech properties in Control Panel.
GetVoiceRetrieves the object token that identifies the voice used in text synthesis.
SpeakSpeaks the contents of a text string or file.
SpeakStreamSpeaks the contents of a stream.
GetStatusRetrieves the current rendering and event status associated with this ISpVoice instance.
SkipCauses the voice to skip forward or backward the specified number of items within the text of the current speak call.
SetPrioritySets the priority for the voice. Normal, Alert, Over.
GetPriorityRetrieves the current voice priority level.
SetAlertBoundarySpecifies which event should be used as the insertion point for alerts.
GetAlertBoundaryRetrieves the event that is currently being used as the insertion point for alerts.
SetRateSets the text rendering rate adjustment in real time.
GetRateRetrieves the current text rendering rate adjustment.
SetVolumeSets the synthesizer output volume level in real time.
GetVolumeRetrieves the current output volume level of the synthesizer.
WaitUntilDoneBlocks the caller until either the voice has completed speaking or the specified time interval has elapsed.
SetSyncSpeakTimeoutSets the timeout interval in milliseconds after which, synchronous Speak and SpeakStream calls to this instance of the voice will timeout.
GetSyncSpeakTimeoutRetrieves the timeout interval for synchronous speech operations for this ISpVoice instance.
SpeakCompleteEventReturns an event handle that will be signaled when the voice has completed speaking all pending requests.
IsUISupportedDetermines if the specified type of UI is supported.
DisplayUIDisplays the requested UI.