Skip to main content

XSpeechSynthesizerGetStreamDataSize

Gets the size of the data buffer from a speech synthesis stream.

Syntax

Parameters

speechSynthesisStream   _In_
Type: XSpeechSynthesizerStreamHandle
The speech synthesizer stream that contains the stream data. bufferSize   _Out_
Type: size_t*
The size of the stream data buffer, in bytes.

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 determine the size of the buffer needed to retrieve the audio data for synthesized speech, from the data buffer of a speech synthesizer stream created by calling the XSpeechSynthesizerCreateStreamFromText function. The maximum data size of the buffer is 0xffffffff bytes: four gigabytes minus one byte.
  • To retrieve the audio data from a speech synthesizer stream, use the value of this function to set the value of the bufferSize parameter for the XSpeechSynthesizerGetStreamData function.
  • For an example that demonstrates how to use the XSpeechSynthesizerGetStreamDataSize 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

XSpeechSynthesizerCreateStreamFromText
XSpeechSynthesizerGetStreamData
XSpeechSynthesizer
Last modified on August 20, 2026