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

# initialize

> chat_manager::initialize

# chat\_manager::initialize

オブジェクト インスタンスを初期化します。

## 構文

```cpp theme={null}
void initialize(  
    uint32_t maxChatUserCount,  
    float defaultAudioRenderVolume= 1.0f,  
    game_chat_communication_relationship_flags defaultLocalToRemoteCommunicationRelationship= game_chat_communication_relationship_flags none,  
    game_chat_shared_device_communication_relationship_resolution_mode sharedDeviceResolutionMode= game_chat_shared_device_communication_relationship_resolution_mode permissive,  
    game_chat_speech_to_text_conversion_mode speechToTextConversionMode= game_chat_speech_to_text_conversion_mode automatic,  
    game_chat_audio_manipulation_mode_flags audioManipulationMode= game_chat_audio_manipulation_mode_flags none  
)  
```

### パラメーター

*maxChatUserCount*   \_In\_\
Type: uint32\_t

任意の時点でローカル chat\_manager インスタンスに追加されるローカルおよびリモート ユーザーの合計最大数。Game Chat は、ユーザー数に比例したメモリを事前に割り当てます。

*defaultAudioRenderVolume*   \_In\_range\_(0,1)\
Type: float

新しいユーザーに使用されるオーディオ レンダリング音量。

*defaultLocalToRemoteCommunicationRelationship*   \_In\_\
Type: [game\_chat\_communication\_relationship\_flags](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/enums/game_chat_communication_relationship_flags.md)

ローカル ユーザーとリモート ユーザーの間で使用される既定の通信関係。つまり、リモート ユーザーが参加した場合、これがすべての既存のローカル ユーザーとそのリモート ユーザーとの間で使用される既定の関係になります。ローカル ユーザーが参加した場合、これがそのローカル ユーザーとすべての既存のリモート ユーザーとの間の既定の関係になります。

*sharedDeviceResolutionMode*   \_In\_\
Type: [game\_chat\_shared\_device\_communication\_relationship\_resolution\_mode](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/enums/game_chat_shared_device_communication_relationship_resolution_mode.md)

通信関係が競合する共有デバイス上のユーザーに対して使用される解決モード。

*speechToTextConversionMode*   \_In\_\
Type: [game\_chat\_speech\_to\_text\_conversion\_mode](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/enums/game_chat_speech_to_text_conversion_mode.md)

音声テキスト変換モードを構成します。

*audioManipulationMode*   \_In\_\
Type: [game\_chat\_audio\_manipulation\_mode\_flags](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/enums/game_chat_audio_manipulation_mode_flags.md)

このパラメーターを game\_chat\_audio\_manipulation\_mode\_flags::none として渡すと、オーディオが中断されることなく Game Chat を通過できます。このパラメーターを game\_chat\_audio\_manipulation\_mode\_flags::pre\_encode\_stream\_manipulation ビットを設定して渡すと、送信側でチャット ユーザーのオーディオ データにアクセスして処理および操作できるようになります。オーディオ データへのアクセスは、[pre\_encode\_audio\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md) オブジェクトを使用することで有効になります。これらのオブジェクトは、[chat\_manager::get\_pre\_encode\_audio\_streams](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_pre_encode_audio_streams.md) メソッドを使用して照会できます。Game Chat が [pre\_encode\_audio\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md) オブジェクトを作成、クローズ、破棄すると、対応する [game\_chat\_stream\_state\_change](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/structs/game_chat_stream_state_change.md) イベントが生成されます。このパラメーターを game\_chat\_audio\_manipulation\_mode\_flags::post\_decode\_stream\_manipulation ビットを設定して渡すと、受信側でチャット ユーザーのオーディオ データにアクセスして処理および操作できるようになります。オーディオ データへのアクセスは、[post\_decode\_audio\_source\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md) および [post\_decode\_audio\_sink\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md) オブジェクトを使用することで有効になります。これらのオブジェクトは、[chat\_manager::get\_post\_decode\_audio\_source\_streams](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_source_streams.md) および [chat\_manager::get\_post\_decode\_audio\_sink\_streams](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_sink_streams.md) メソッドを使用して照会できます。Game Chat が [post\_decode\_audio\_source\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md) および [post\_decode\_audio\_sink\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md) オブジェクトを作成、クローズ、破棄すると、対応する [game\_chat\_stream\_state\_change](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/structs/game_chat_stream_state_change.md) イベントが生成されます。

### 戻り値

Type: void

## 解説

これは、静的メソッドの chat\_manager::singleton\_instance()、chat\_manager::set\_memory\_callbacks()、chat\_manager::get\_memory\_callbacks()、chat\_manager::set\_thread\_processor()、chat\_manager::get\_thread\_processor() を除いて、他のどのメソッドよりも先に呼び出す必要があります。chat\_manager::initialize() は、対応する chat\_manager::cleanup() 呼び出しなしに再度呼び出すことはできません。

chat\_manager::initialize() の呼び出しはすべて、対応する chat\_manager::cleanup() 呼び出しを行う必要があります。

## 要件

**ヘッダー:** GameChat2.h

**サポートされているプラットフォーム:** Windows、XBOX One ファミリ本体および XBOX Series 本体

## 関連項目

[chat\_manager](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/chat_manager.md)\
[chat\_manager::cleanup](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_cleanup.md)\
[chat\_manager::singleton\_instance](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_singleton_instance.md)\
[chat\_manager::set\_memory\_callbacks](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)\
[chat\_manager::get\_memory\_callbacks](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks.md)\
[chat\_manager::set\_thread\_processor](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_processor.md)\
[chat\_manager::get\_thread\_processor](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_thread_processor.md)\
[pre\_encode\_audio\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md)\
[post\_decode\_audio\_source\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md)\
[post\_decode\_audio\_sink\_stream](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md)


## Related topics

- [Initialize](https://docs.xbox.com/ja-jp/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_initialize.md)
- [HCInitialize](https://docs.xbox.com/ja-jp/reference/live/httpclient/httpclient/functions/hcinitialize.md)
- [PFInitialize](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfcore/functions/pfinitialize_2.md)
- [XblInitialize](https://docs.xbox.com/ja-jp/reference/live/xsapi-c/xbox_live_global_c/functions/xblinitialize.md)
- [PFServicesInitialize](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfservices/functions/pfservicesinitialize_2.md)
