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

# XSpeechSynthesizerCloseStreamHandle

> XSpeechSynthesizerCloseStreamHandle

# XSpeechSynthesizerCloseStreamHandle

音声合成器ストリームを閉じ、割り当てられたシステム リソースを解放します。

## Syntax

```cpp theme={null}
HRESULT XSpeechSynthesizerCloseStreamHandle(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream  
)  
```

### Parameters

*speechSynthesisStream*   \_In\_\
型: XSpeechSynthesizerStreamHandle

閉じる音声合成ストリーム。

### 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) 関数を呼び出して作成した音声合成器ストリームを閉じます。

メモリ リークを防ぐため、ハンドルを使用するすべての操作が完了した後、この関数を呼び出して音声合成器ストリーム ハンドルを閉じてください。この関数を呼び出す前に、未完了の非同期操作をすべて完了させておく必要があります。

**XSpeechSynthesizerCloseStreamHandle** 関数の使用方法を示す例については、[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)\
[XSpeechSynthesizerCloseHandle](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle.md)\
[XSpeechSynthesizer](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerCloseHandle](https://docs.xbox.com/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle.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)
- [テキスト読み上げ](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)
