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

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](https://docs.xbox.com/reference/chat/gamechat2/enums/game_chat_communication_relationship_flags.md)

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](https://docs.xbox.com/reference/chat/gamechat2/enums/game_chat_shared_device_communication_relationship_resolution_mode.md)

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](https://docs.xbox.com/reference/chat/gamechat2/enums/game_chat_speech_to_text_conversion_mode.md)

Configures the speech-to-text conversion mode.

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

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](https://docs.xbox.com/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md) objects. These objects can be queried for using the [chat\_manager::get\_pre\_encode\_audio\_streams](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_pre_encode_audio_streams.md) method. When Game Chat creates, closes, and destroys [pre\_encode\_audio\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md) objects, corresponding [game\_chat\_stream\_state\_change](https://docs.xbox.com/reference/chat/gamechat2/structs/game_chat_stream_state_change.md) 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](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md) and [post\_decode\_audio\_sink\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md) objects. These objects can be queried for using the [chat\_manager::get\_post\_decode\_audio\_source\_streams](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_source_streams.md) and [chat\_manager::get\_post\_decode\_audio\_sink\_streams](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_post_decode_audio_sink_streams.md) methods. When Game Chat creates, closes, and destroys [post\_decode\_audio\_source\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md) and [post\_decode\_audio\_sink\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md) objects, corresponding [game\_chat\_stream\_state\_change](https://docs.xbox.com/reference/chat/gamechat2/structs/game_chat_stream_state_change.md) 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](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/chat_manager.md)\
[chat\_manager::cleanup](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_cleanup.md)\
[chat\_manager::singleton\_instance](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_singleton_instance.md)\
[chat\_manager::set\_memory\_callbacks](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)\
[chat\_manager::get\_memory\_callbacks](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks.md)\
[chat\_manager::set\_thread\_processor](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_processor.md)\
[chat\_manager::get\_thread\_processor](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_thread_processor.md)\
[pre\_encode\_audio\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream.md)\
[post\_decode\_audio\_source\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream.md)\
[post\_decode\_audio\_sink\_stream](https://docs.xbox.com/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream.md)


## Related topics

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