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

# GetShapePcmBufferLength

> GetShapePcmBufferLength

# GetShapePcmBufferLength

Gets the audio buffer's length in samples.

## Syntax

```cpp theme={null}
UINT32 GetShapePcmBufferLength(  
         const SHAPE_PCM_CONTEXT* context  
)  
```

### Parameters

*context*   \_In\_\
Type: [SHAPE\_PCM\_CONTEXT\*](/reference/audio/shapepcmcontext/structs/shape_pcm_context)

Pointer to a [SHAPE\_PCM\_CONTEXT](/reference/audio/shapepcmcontext/structs/shape_pcm_context) structure.

### Return value

Type: UINT32

The buffer length in samples.

## Remarks

The Sample Rate Convertor (SRC) block reads 16-bit, 24-bit, or 32-bit fixed-point or 32-bit floating-point Pulse Code Modulation (PCM) data from system memory and performs integer-based sample rate conversion. The output data is written to mix buffers. For input data, the SRC block can either take the output of the XMA hardware decoder or data that is maintained by software. The SRC block has tight integration with the XMA decoder. This allows the SRC block to determine whether the XMA decode buffer has enough samples of decoded PCM data without reading main memory.

An SRC process is typically used for musical instrument emulation, conversion of input samples to an octave lower or higher than the source, or effects such as the Doppler effect.

The SRC operates in either mono or stereo mode. The PCM data is read from memory and converted to a common 24-bit fixed-point format for sample rate conversion. The output is written to either one or two mix buffers depending on the mode. Stereo data is stored in memory as an interleaved stream of 16-bit data with the left channel in the least significant 16 bits of each 32-bit word and the right channel in the most significant 16 bits. In stereo mode, the PCM data is read and simultaneously de-interleaved. The left channel data (even-numbered samples) is processed and output to one mix buffer and the right channel data (odd-numbered samples) is written to a second mix buffer.

## Requirements

**Header:** shapepcmcontext.h

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

## See also

[Overview of ACP](/build/console-features/audio/overviews/acp-overview)\
[Overview of Shape](/build/console-features/audio/overviews/shape-overview)\
[shapepcmcontext](/reference/audio/shapepcmcontext/shapepcmcontext_members)


## Related topics

- [ShapePcmContext](/reference/audio/shapepcmcontext/shapepcmcontext_members.md)
- [SetShapePcmBufferLength](/reference/audio/shapepcmcontext/functions/setshapepcmbufferlength.md)
- [GetShapePcmAudioBuffer](/reference/audio/shapepcmcontext/functions/getshapepcmaudiobuffer.md)
- [GetShapePcmBufferFull](/reference/audio/shapepcmcontext/functions/getshapepcmbufferfull.md)
- [SHAPE_PCM_CONTEXT](/reference/audio/shapepcmcontext/structs/shape_pcm_context.md)
