Skip to main content

XSpeechSynthesizerCloseStreamHandle

Closes the speech synthesizer stream and releases allocated system resources.

Syntax

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

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

Conceptual documentation

See also

XAccessibility
XSpeechSynthesizerCloseHandle
XSpeechSynthesizer
Last modified on August 20, 2026