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

# chat_manager::initialize

> chat_manager::initialize

# chat\_manager::initialize

Initializes the object instance.

## Syntax

```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  
)  
```

### Parameters

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

The maximum total number of local and remote users that will be added to the local chat\_manager instance at any given time. Game Chat pre-allocates memory proportional to the number of users.

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

The audio render volume that will be used for new users.

*defaultLocalToRemoteCommunicationRelationship*   \_In\_\
Type: [game\_chat\_communication\_relationship\_flags](/reference/chat/gamechat2/enums/game_chat_communication_relationship_flags)

The default communication relationship that will be used between local and remote users. I.e. when a remote user joins, this will be the default relationship used between all existing local users and that remote user. When a local user joins, this will be the default relationship between that local user and all existing remote users.

*sharedDeviceResolutionMode*   \_In\_\
Type: [game\_chat\_shared\_device\_communication\_relationship\_resolution\_mode](/reference/chat/gamechat2/enums/game_chat_shared_device_communication_relationship_resolution_mode)

The resolution mode used for users on a shared device who have conflicting communication relationships.

*speechToTextConversionMode*   \_In\_\
Type: [game\_chat\_speech\_to\_text\_conversion\_mode](/reference/chat/gamechat2/enums/game_chat_speech_to_text_conversion_mode)

Configures the speech-to-text conversion mode.

*audioManipulationMode*   \_In\_\
Type: [game\_chat\_audio\_manipulation\_mode\_flags](/reference/chat/gamechat2/enums/game_chat_audio_manipulation_mode_flags)

Passing this param as game\_chat\_audio\_manipulation\_mode\_flags::none allows audio to flow through Game Chat uninterrupted. Passing this param with the game\_chat\_audio\_manipulation\_mode\_flags::pre\_encode\_stream\_manipulation bit set grants access to chat user audio data for processing and manipulation on the sender-side. Access to the audio data is enabled through the use of the [pre\_encode\_audio\_stream](/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream) objects. These objects can be queried for using the [chat\_manager::get\_pre\_encode\_audio\_streams](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_pre_encode_audio_streams) method. When Game Chat creates, closes, and destroys [pre\_encode\_audio\_stream](/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream) objects, corresponding [game\_chat\_stream\_state\_change](/reference/chat/gamechat2/structs/game_chat_stream_state_change) events will be generated. Passing this param with the game\_chat\_audio\_manipulation\_mode\_flags::post\_decode\_stream\_manipulation bit set grants access to chat user audio data for processing and manipulation on the receiver-side. Access to the audio data is enabled through the use of the [post\_decode\_audio\_source\_stream](/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream) and [post\_decode\_audio\_sink\_stream](/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream) objects. These objects can be queried for using the [chat\_manager::get\_post\_decode\_audio\_source\_streams](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_source_streams) and [chat\_manager::get\_post\_decode\_audio\_sink\_streams](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_sink_streams) methods. When Game Chat creates, closes, and destroys [post\_decode\_audio\_source\_stream](/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream) and [post\_decode\_audio\_sink\_stream](/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream) objects, corresponding [game\_chat\_stream\_state\_change](/reference/chat/gamechat2/structs/game_chat_stream_state_change) events will be generated.

### Return value

Type: void

## Remarks

This must be called before any other method, aside from the static methods chat\_manager::singleton\_instance(), chat\_manager::set\_memory\_callbacks(), chat\_manager::get\_memory\_callbacks(), chat\_manager::set\_thread\_processor(), and chat\_manager::get\_thread\_processor(). chat\_manager::initialize() cannot be called again without a subsequent chat\_manager::cleanup() call.

Every call to chat\_manager::initialize() should have a corresponding chat\_manager::cleanup() call.

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

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


## Related topics

- [chat_manager::cleanup](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_cleanup.md)
- [chat_manager::set_thread_processor](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_processor.md)
- [chat_manager::set_thread_affinity_mask](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_affinity_mask.md)
- [chat_manager::set_legacy_era_uwp_compat_mode_enabled](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_legacy_era_uwp_compat_mode_enabled.md)
- [chat_manager::get_memory_callbacks](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks.md)
