> ## 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.

# XSpeechSynthesizerGetStreamDataSize

> XSpeechSynthesizerGetStreamDataSize

# XSpeechSynthesizerGetStreamDataSize

音声合成ストリームからデータ バッファーのサイズを取得します。

## Syntax

```cpp theme={null}
HRESULT XSpeechSynthesizerGetStreamDataSize(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream,  
         size_t* bufferSize  
)  
```

### Parameters

*speechSynthesisStream*   \_In\_\
型: XSpeechSynthesizerStreamHandle

ストリーム データを格納する音声合成器ストリーム。

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

ストリーム データ バッファーのサイズ (バイト単位)。

### 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) を参照してください。

## 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) 関数を呼び出して作成した音声合成器ストリームのデータ バッファーから、合成された音声のオーディオ データを取得するために必要なバッファーのサイズを判定します。バッファーの最大データ サイズは 0xffffffff バイト、つまり 4 ギガバイトから 1 バイトを引いたサイズです。

* 音声合成器ストリームからオーディオ データを取得するには、この関数の値を使用して、[XSpeechSynthesizerGetStreamData](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md) 関数の *bufferSize* パラメーターの値を設定します。

* **XSpeechSynthesizerGetStreamDataSize** 関数の使用方法を示す例については、[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

[XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)\
[XSpeechSynthesizerGetStreamData](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md)\
[XSpeechSynthesizer](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerGetStreamData](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.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)
