> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md) によって返されるバッファーのサイズ (バイト単位)。

*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** を返します。そうでない場合はエラー コードを返します。エラー コードの一覧については、[エラー コード](https://docs.xbox.com/ja-jp/reference/errorcodes.md) を参照してください。*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) を参照してください。

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

**XSpeechSynthesizerGetStreamData** 関数の使用方法を示す例については、[XSpeechSynthesizerCreate](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md) を参照してください。

## Requirements

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

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

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

## Conceptual documentation

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

## See also

[XAccessibility](https://docs.xbox.com/ja-jp/reference/system/xaccessibility/xaccessibility_members.md)\
[XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)\
[XSpeechSynthesizer](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)
- [テキスト読み上げ](https://docs.xbox.com/ja-jp/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizerCreateStreamFromSsml](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
- [XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
