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

# XSpeechSynthesizerSetDefaultVoice

> XSpeechSynthesizerSetDefaultVoice

# XSpeechSynthesizerSetDefaultVoice

音声合成器がシステムの既定の音声を使用するように指定します。

## Syntax

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

### Parameters

*speechSynthesizer*   \_In\_\
型: 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>

* 指定した音声合成器に別のインストール済み音声を使用するには、[XSpeechSynthesizerSetCustomVoice](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice) を呼び出します。

* 現在のデバイスにインストールされている音声を列挙し情報を取得するには、[XSpeechSynthesizerEnumerateInstalledVoices](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices) 関数を [XSpeechSynthesizerInstalledVoicesCallback](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback) コールバック関数と共に使用します。

* インストールされている各音声について、[XSpeechSynthesizerVoiceInformation](/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation) 構造体は音声 ID、説明、表示テキスト、性別、言語、その他の情報を提供します。

## 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)\
[XSpeechSynthesizerCreateStreamFromText](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerSetCustomVoice](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md)
- [テキスト読み上げ](/ja-jp/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizer](/ja-jp/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [XSpeechSynthesizerCreate](/ja-jp/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
