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

# XSpeechSynthesizerCloseHandle

> XSpeechSynthesizerCloseHandle

# XSpeechSynthesizerCloseHandle

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

## Syntax

```cpp theme={null}
HRESULT XSpeechSynthesizerCloseHandle(  
         XSpeechSynthesizerHandle speechSynthesizer  
)  
```

### Parameters

*speechSynthesizer*   \_In\_opt\_\
型: XSpeechSynthesizerHandle

閉じる音声合成器。

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

* この関数を使用して、[XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate) 関数を呼び出して作成した音声合成器を閉じます。

* メモリ リークを防ぐため、ハンドルを使用するすべての操作が完了した後、この関数を呼び出して音声合成器ハンドルを閉じてください。

* **XSpeechSynthesizerCloseHandle** 関数の使用方法を示す例については、[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)\
[XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate)\
[XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerCloseStreamHandle](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md)
- [XSpeechSynthesizerCreate](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizer](/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XSpeechSynthesizerCreateStreamFromSsml](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
