SpeakAsync Method

Microsoft Speech Platform SDK 11

Collapse imageExpand ImageCopy imageCopyHover image

Generates speech output asynchronously from a string, a Prompt object, or a PromptBuilder object.

Overload List

  NameDescription
Public methodSpeakAsync(String)Asynchronously speaks the contents of a string.
Public methodSpeakAsync(Prompt)Asynchronously speaks the contents of a Prompt object.
Public methodSpeakAsync(PromptBuilder)Asynchronously speaks the contents of a PromptBuilder object.
Top

Remarks

The SpeakAsync()()()() methods generate speech asynchronously. The methods return immediately without waiting for the content of the SpeakAsync()()()() object to finish speaking. Use SpeakAsync()()()() if your application needs to perform tasks while speaking, for example highlight text, paint animation, monitor controls, or other tasks.

During a call to this method, the SpeechSynthesizer can raise the following events:

  • StateChanged. Raised when the speaking state of the synthesizer changes.

  • SpeakStarted. Raised when the synthesizer begins generating speech.

  • SpeakProgress. Raised each time the synthesizer completes speaking a word.

  • BookmarkReached. Raised when the synthesizer encounters a bookmark in a prompt.

  • VoiceChange. Raised when the speaking voice for the synthesizer changes.

  • SpeakCompleted. Raised when the synthesizer finishes a SpeakAsync()()()() operation.

If your application does not need to perform tasks while speaking, you can use the Speak()()()() methods or the SpeakSsml(String) method to generate speech synchronously.

See Also