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

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

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

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

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

[XSpeechSynthesizerCreateStreamFromText](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)\
[XSpeechSynthesizerGetStreamData](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

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