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

# SetShapeXmaSampleRate(SHAPE_XMA_CONTEXT*, SHAPE_XMA_SAMPLE_RATE)

> SetShapeXmaSampleRate(SHAPE_XMA_CONTEXT*, SHAPE_XMA_SAMPLE_RATE)

# SetShapeXmaSampleRate(SHAPE\_XMA\_CONTEXT\*, SHAPE\_XMA\_SAMPLE\_RATE)

Sets the sample rate.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT SetShapeXmaSampleRate(  
         SHAPE_XMA_CONTEXT* context,  
         SHAPE_XMA_SAMPLE_RATE sampleRate  
)  
```

<a id="parametersSection" />

### Parameters

*context*   \_Inout\_\
Type: [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context)\*

Pointer to a [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context) object.

*sampleRate*   \
Type: [SHAPE\_XMA\_SAMPLE\_RATE](/reference/audio/shapexmacontext/enums/shape_xma_sample_rate)

A member of the [SHAPE\_XMA\_SAMPLE\_RATE](/reference/audio/shapexmacontext/enums/shape_xma_sample_rate) enumeration.

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="remarksSection" />

## Remarks

To set the sample rate by specifying an integer, use [SetShapeXmaSampleRate(SHAPE\_XMA\_CONTEXT\*, UINT32)](/reference/audio/shapexmacontext/functions/setshapexmasamplerate_2).

To get the current sample rate, use [GetShapeXmaSampleRate](/reference/audio/shapexmacontext/functions/getshapexmasamplerate).

For more information, see the [XMA](/build/console-features/audio/overviews/shape-overview#ID4EYD) section of [Overview of SHAPE](/build/console-features/audio/overviews/shape-overview).

<a id="requirementsSection" />

## Requirements

**Header:** shapexmacontext.h

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

<a id="seealsoSection" />

## See also

[ShapeXmaContext](/reference/audio/shapexmacontext/shapexmacontext_members)


## Related topics

- [SHAPE_XMA_SAMPLE_RATE](/reference/audio/shapexmacontext/enums/shape_xma_sample_rate.md)
- [GetShapeXmaSampleRate](/reference/audio/shapexmacontext/functions/getshapexmasamplerate.md)
- [ShapeXmaContext](/reference/audio/shapexmacontext/shapexmacontext_members.md)
- [SHAPE_XMA_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context.md)
- [SetShapeSrcXmaBlocksToSkip](/reference/audio/shapesrccontext/functions/setshapesrcxmablockstoskip.md)
