Freigeben über


XSpeechSynthesizerGetStreamData

Retrieves the data from a speech synthesis stream.

Syntax

HRESULT XSpeechSynthesizerGetStreamData(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream,  
         size_t bufferSize,  
         void* buffer,  
         size_t* bufferUsed  
)  

Parameters

speechSynthesisStream   _In_
Type: XSpeechSynthesizerStreamHandle

The speech synthesis stream that contains the data buffer.

bufferSize   _In_
Type: size_t

The size of the buffer, in bytes, returned by XSpeechSynthesizerGetStreamDataSize.

buffer   _Out_writes_to_(bufferSize,bufferUsed)
Type: void

A pointer to the data buffer that will receive the data.

bufferUsed   _Out_opt_
Type: size_t*

The size of the data received in 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. If the function fails because speechSynthesisStream isn't set to a valid speech synthesizer stream handle, the return value is set to HRESULT_FROM_WIN32(ERROR_NOT_FOUND).

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 retrieve the audio data for synthesized speech, from the data buffer of a speech synthesizer stream created by calling the XSpeechSynthesizerCreateStreamFromText function. The audio data is returned in the WAVE container (audio/wav MIME type) format.

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

Requirements

Header: XSpeechSynthesizer.h

Library: xgameruntime.lib

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

See also

XAccessibility
XSpeechSynthesizerGetStreamDataSize
XSpeechSynthesizer