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

# 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\*](/services/playfab/multiplayer/networking/reference/structs/partymutabledatabuffer)\
*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()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## 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()](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_returnbuffer) when they're done being used. <br /><br /> The total number of buffers instantaneously available can be retrieved via [PartyAudioManipulationSourceStream::GetAvailableBufferCount()](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getavailablebuffercount). Multiple buffers can be retrieved in succession before any are returned.   <br /><br /> Each buffer is in the format specified by [PartyAudioManipulationSourceStream::GetFormat()](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getformat).   <br /><br /> A mutable data buffer is provided so that the app can optionally modify the audio in place.

## Requirements

**Header:** Party.h

## See also

[PartyAudioManipulationSourceStream](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/partyaudiomanipulationsourcestream)\
[PartyAudioManipulationSourceStream::GetFormat](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_getformat)\
[PartyAudioManipulationSourceStream::ReturnBuffer](/services/playfab/multiplayer/networking/reference/classes/PartyAudioManipulationSourceStream/methods/partyaudiomanipulationsourcestream_returnbuffer)


## Related topics

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