> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XSpeechSynthesizerGetStreamData

> XSpeechSynthesizerGetStreamData

# XSpeechSynthesizerGetStreamData

音声合成ストリームからデータを取得します。

## Syntax

```cpp theme={null}
HRESULT XSpeechSynthesizerGetStreamData(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream,  
         size_t bufferSize,  
         void* buffer,  
         size_t* bufferUsed  
)  
```

### Parameters

*speechSynthesisStream*   \_In\_\
型: XSpeechSynthesizerStreamHandle

データ バッファーを格納する音声合成ストリーム。

*bufferSize*   \_In\_\
型: size\_t

[XSpeechSynthesizerGetStreamDataSize](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize) によって返されるバッファーのサイズ (バイト単位)。

*buffer*   \_Out\_writes\_to\_(bufferSize,*bufferUsed)\
型: void*

データを受け取るデータ バッファーへのポインター。

*bufferUsed*   \_Out\_opt\_\
型: size\_t\*

*buffer* に受信したデータのサイズ (バイト単位)。

### Return value

型: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

成功した場合は **S\_OK** を返します。そうでない場合はエラー コードを返します。エラー コードの一覧については、[エラー コード](/reference/errorcodes) を参照してください。*speechSynthesisStream* が有効な音声合成器ストリーム ハンドルに設定されていないために関数が失敗した場合、戻り値は **HRESULT\_FROM\_WIN32(ERROR\_NOT\_FOUND)** に設定されます。

## Remarks

<Note>この関数はタイム センシティブ スレッドで呼び出すのは安全ではありません。詳細については、[タイム センシティブ スレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads) を参照してください。</Note>

この関数を使用して、[XSpeechSynthesizerCreateStreamFromText](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext) 関数を呼び出して作成された音声合成器ストリームのデータ バッファーから、合成された音声のオーディオ データを取得します。オーディオ データは WAVE コンテナー (`audio/wav` MIME タイプ) 形式で返されます。

**XSpeechSynthesizerGetStreamData** 関数の使用方法を示す例については、[XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate) を参照してください。

## Requirements

**ヘッダー:** XSpeechSynthesizer.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [テキスト読み上げ](/build/console-features/text-to-speech/text-to-speech)
* [タイム センシティブ スレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerGetStreamDataSize](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerGetStreamDataSize](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)
- [テキスト読み上げ](/ja-jp/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizer](/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [XSpeechSynthesizerCreateStreamFromSsml](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
- [XSpeechSynthesizerCreateStreamFromText](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
