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

# SetShapeXmaSampleRate(SHAPE_XMA_CONTEXT*, SHAPE_XMA_SAMPLE_RATE)

> SetShapeXmaSampleRate(SHAPE_XMA_CONTEXT*, SHAPE_XMA_SAMPLE_RATE)

Sets the sample rate.

## Syntax

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

### Parameters

*context*   \_Inout\_\
Type: [SHAPE\_XMA\_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md)\*

Pointer to a [SHAPE\_XMA\_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md) object.

*sampleRate*   \
Type: [SHAPE\_XMA\_SAMPLE\_RATE](https://docs.xbox.com/reference/audio/shapexmacontext/enums/shape_xma_sample_rate.md)

A member of the [SHAPE\_XMA\_SAMPLE\_RATE](https://docs.xbox.com/reference/audio/shapexmacontext/enums/shape_xma_sample_rate.md) enumeration.

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

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

To get the current sample rate, use [GetShapeXmaSampleRate](https://docs.xbox.com/reference/audio/shapexmacontext/functions/getshapexmasamplerate.md).

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

## Requirements

**Header:** shapexmacontext.h

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

## See also

[ShapeXmaContext](https://docs.xbox.com/reference/audio/shapexmacontext/shapexmacontext_members.md)


## Related topics

- [SHAPE_XMA_SAMPLE_RATE](https://docs.xbox.com/reference/audio/shapexmacontext/enums/shape_xma_sample_rate.md)
- [SetShapeXmaSampleRate(SHAPE_XMA_CONTEXT*, UINT32)](https://docs.xbox.com/reference/audio/shapexmacontext/functions/setshapexmasamplerate_2.md)
- [GetShapeXmaSampleRate](https://docs.xbox.com/reference/audio/shapexmacontext/functions/getshapexmasamplerate.md)
- [ShapeXmaContext](https://docs.xbox.com/reference/audio/shapexmacontext/shapexmacontext_members.md)
- [SHAPE_XMA_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md)
