XSpeechSynthesizerCloseStreamHandle

Closes the speech synthesizer stream and releases allocated system resources.

Syntax

HRESULT XSpeechSynthesizerCloseStreamHandle(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream  
)  

Parameters

speechSynthesisStream   _In_
Type: XSpeechSynthesizerStreamHandle

The speech synthesis stream to close.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

Use this function to close a speech synthesizer stream created by calling the XSpeechSynthesizerCreateStreamFromText function.

To prevent memory leaks, call this function to close a speech synthesizer stream handle after you've completed all operations that are using the handle. All outstanding asynchronous operations must be completed before this function is called.

For an example that demonstrates how to use the XSpeechSynthesizerCloseStreamHandle function, see XSpeechSynthesizerCreate.

Requirements

Header: XSpeechSynthesizer.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XAccessibility
XSpeechSynthesizerCloseHandle
XSpeechSynthesizer