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

# SetShapePcmMode

> SetShapePcmMode

# SetShapePcmMode

Sets the PCM mode.

## Syntax

```cpp theme={null}
HRESULT SetShapePcmMode(  
         SHAPE_PCM_CONTEXT* context,  
         SHAPE_PCM_MODE mode  
)  
```

### Parameters

*context*   \_Inout\_\
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.

*mode*   \
Type: [SHAPE\_PCM\_MODE](/reference/audio/shapepcmcontext/enums/shape_pcm_mode)

One member of the [SHAPE\_PCM\_MODE](/reference/audio/shapepcmcontext/enums/shape_pcm_mode) enumeration.

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

The Sample Rate Convertor (SRC) operates in either mono or stereo mode. The Pulse Code Modulation (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)
- [SHAPE_PCM_MODE](/reference/audio/shapepcmcontext/enums/shape_pcm_mode.md)
- [SetShapePcmAudioBuffer](/reference/audio/shapepcmcontext/functions/setshapepcmaudiobuffer_2.md)
- [SetShapePcmBufferFull](/reference/audio/shapepcmcontext/functions/setshapepcmbufferfull.md)
- [SetShapePcmBufferLength](/reference/audio/shapepcmcontext/functions/setshapepcmbufferlength.md)
