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

# PartyAudioManipulationSourceStream::GetNextBuffer

> Gets the next buffer available in the stream.

Gets the next buffer available in the stream.

## Syntax

```cpp theme={null}
PartyError GetNextBuffer(  
    PartyMutableDataBuffer* buffer  
)  
```

### Parameters

**`buffer`**   [PartyMutableDataBuffer\*](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partymutabledatabuffer.md)\
*output*

The output buffer. If no buffer is available, the PartyMutableDataBuffer's *bufferByteCount* field is 0, and its *buffer* field is nullptr.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PartyManager::GetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage.md).

## Remarks

When voice activity is detected, a new buffer is available every 40 ms. Otherwise, no buffers are available. Buffers retrieved by this method must be returned to the library via [PartyAudioManipulationSourceStream::ReturnBuffer()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_returnbuffer.md) when they're done being used. \
\
&#x20;The total number of buffers instantaneously available can be retrieved via [PartyAudioManipulationSourceStream::GetAvailableBufferCount()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getavailablebuffercount.md). Multiple buffers can be retrieved in succession before any are returned.   \
\
&#x20;Each buffer is in the format specified by [PartyAudioManipulationSourceStream::GetFormat()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getformat.md).   \
\
&#x20;A mutable data buffer is provided so that the app can optionally modify the audio in place.

## Requirements

**Header:** Party.h

## See also

[PartyAudioManipulationSourceStream](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/partyaudiomanipulationsourcestream.md)\
[PartyAudioManipulationSourceStream::GetFormat](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getformat.md)\
[PartyAudioManipulationSourceStream::ReturnBuffer](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_returnbuffer.md)


## Related topics

- [PartyAudioManipulationSourceStream](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/partyaudiomanipulationsourcestream.md)
- [PartyAudioManipulationSourceStream::ReturnBuffer](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_returnbuffer.md)
- [PartyAudioManipulationSourceStream::GetFormat](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getformat.md)
- [PartyAudioManipulationSourceStream::GetAvailableBufferCount](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getavailablebuffercount.md)
- [PartyAudioManipulationSourceStreamConfiguration](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partyaudiomanipulationsourcestreamconfiguration.md)
