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

# game_chat_stream_state_change

> game_chat_stream_state_change

# game\_chat\_stream\_state\_change

A generic, base structure representation of an event for audio manipulation streams.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
typedef struct game_chat_stream_state_change {  
    game_chat_stream_state_change_type state_change_type;  
    union  
    {  
        pre_encode_audio_stream* pre_encode_audio_stream;  
        post_decode_audio_source_stream* post_decode_audio_source_stream;  
        post_decode_audio_sink_stream* post_decode_audio_sink_stream;  
    };  
} game_chat_stream_state_change  
```

<a id="membersSection" />

### Members

*state\_change\_type*\
Type: [game\_chat\_stream\_state\_change\_type](/reference/chat/gamechat2/enums/game_chat_stream_state_change_type)

The specific type of the stream state change represented. Use this field to determine which type of stream field to read from the stream union.

*pre\_encode\_audio\_stream*\
Type: [pre\_encode\_audio\_stream](/reference/chat/gamechat2/classes/pre_encode_audio_stream/pre_encode_audio_stream)\*

A pointer to the pre-encode audio stream that the stream state change applies to.

*post\_decode\_audio\_source\_stream*\
Type: [post\_decode\_audio\_source\_stream](/reference/chat/gamechat2/classes/post_decode_audio_source_stream/post_decode_audio_source_stream)\*

A pointer to the post-decode audio stream that the stream state change applies to.

*post\_decode\_audio\_sink\_stream*\
Type: [post\_decode\_audio\_sink\_stream](/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/post_decode_audio_sink_stream)\*

A pointer to the post-decode audio sink stream that the stream state change applies to.

<a id="remarksSection" />

## Remarks

This structure represents a stream state change, such as the creation of a pre-encode audio stream. `game_chat_stream_state_change` structures are reported by the [chat\_manager::start\_processing\_stream\_state\_changes](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_start_processing_stream_state_changes) method. The app handles the represented stream state changes, and then promptly passes them back by calling the [chat\_manager::finish\_processing\_stream\_state\_changes](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_finish_processing_stream_state_changes) method.

The *state\_change\_type* field indicates what kind of state change occurred. Your app should use the value of this field to determine the type of stream to which the stream state change applies, and then retrieve the corresponding pointer for that stream from the union in this structure.

<Note>Stream state changes occur only if local or remote audio manipulation is enabled when [chat\_manager::initialize](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize) was called. For more information about enabling audio manipulation, see [Real-time audio manipulation](/services/xbox-services/multiplayer/chat/game-chat2/real-time-audio-manipulation).</Note>

<a id="array" />

### game\_chat\_stream\_state\_change\_array

The `game_chat_stream_state_change_array` type is a constant array of `game_chat_stream_state_change` pointers. This type is provided for convenience, and is used with the `chat_manager::start_processing_stream_state_changes` and `chat_manager::finish_processing_stream_state_changes` methods.

```cpp theme={null}
typedef class game_chat_stream_state_change * const * game_chat_stream_state_change_array;
```

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

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

<a id="seealsoSection" />

## Conceptual documentation

* [Using the Game Chat 2 C++ API](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)
* [Real-time audio manipulation](/services/xbox-services/multiplayer/chat/game-chat2/real-time-audio-manipulation)

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager)\
[GameChat2 members](/reference/chat/gamechat2/gamechat2_members)


## Related topics

- [game_chat_stream_state_change_type](/reference/chat/gamechat2/enums/game_chat_stream_state_change_type.md)
- [chat_manager::finish_processing_stream_state_changes](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_finish_processing_stream_state_changes.md)
- [game_chat_state_change_type](/reference/chat/gamechat2/enums/game_chat_state_change_type.md)
- [chat_manager::start_processing_stream_state_changes](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_start_processing_stream_state_changes.md)
- [Real-time audio manipulation](/services/xbox-services/multiplayer/chat/game-chat2/real-time-audio-manipulation.md)
