ISpVoice
Other versions of this page are also available for the following:
8/28/2008
This interface enables an application to perform text synthesis operations. Applications can speak text strings and text files, or play audio files through this interface. These can be done synchronously or asynchronously.
Applications can choose a specific text-to-speech (TTS) voice using the ISpVoice::SetVoice method. 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 the ISpVoice::SetRate and ISpVoice::SetVolume methods. Voices can be set to different priorities using the 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.
When to Implement
The following class IDs (CLSID) can be used with this interface. A complete CLSID listing for all interfaces is in the Class IDs section.
- CLSID_SpVoice
Methods
The following table lists methods for the ISpVoice interface.
Method | Description |
---|---|
Displays the requested UI. |
|
Gets the event that is currently being used as the insertion point for alerts. |
|
Gets the object token for the current output object. |
|
Gets a pointer to the current output stream. |
|
Gets the current voice priority level. |
|
Gets the current text rendering rate adjustment. |
|
Gets the current rendering and event status associated with this ISpVoice instance. |
|
Gets the timeout interval for synchronous speech operations for this ISpVoice instance. |
|
Gets the object token that identifies the voice used in text synthesis. |
|
Gets the current output volume level of the synthesizer. |
|
Determines if the specified type of UI is supported. |
|
Pauses the voice at the nearest alert boundary and closes the output device. |
|
Sets the output device to the RUN state and resumes rendering. |
|
Specifies which event should be used as the insertion point for alerts. |
|
Sets the current output object. A value of NULL can be used to select the default audio device. |
|
Sets the priority for the voice. Normal, Alert, Over. |
|
Sets the text rendering rate adjustment in real time. |
|
Sets the timeout interval in milliseconds after which, synchronous Speak and SpeakStream calls to this instance of the voice will timeout. |
|
Sets the identity of the voice used for text synthesis. By default, the ISpVoice will use the voice information set in Control Panel. |
|
Gets the current output volume level of the synthesizer. |
|
Causes the voice to skip ahead the specified number of items within the current speak request. |
|
Submits a string for rendering. |
|
Returns an event handle that will be signaled when the voice has completed speaking all pending requests. |
|
Speaks the contents of a stream. |
|
Blocks the caller until either the voice has completed speaking or the specified time interval has elapsed. |
Requirements
Header | sapi.h, sapi.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |