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

# GetShapePcmLoopCount

> GetShapePcmLoopCount

Gets the loop count.

## Syntax

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

### Parameters

*context*   \_In\_\
Type: [SHAPE\_PCM\_CONTEXT\*](https://docs.xbox.com/reference/audio/shapepcmcontext/structs/shape_pcm_context.md)

Pointer to a [SHAPE\_PCM\_CONTEXT](https://docs.xbox.com/reference/audio/shapepcmcontext/structs/shape_pcm_context.md) structure.

### Return value

Type: UINT32

Specifies the loop count.

## Remarks

| Function | Description |
| - | - |
| Non-looping linear PCM | Start the voice using the `SHAPE_SRC_COMMAND_TYPE_START` constant for the Sample Rate Convertor (SRC). Let the voice play to the end, or optionally stop it short of the end using the `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE` constant. For more information, see the [SHAPE\_SRC\_COMMAND\_TYPE](https://docs.xbox.com/reference/audio/shapesrccontext/enums/shape_src_command_type.md) enumeration. |
| Infinite looping linear PCM | Set the Pulse Code Modulation (PCM) context loop count *loopCount* to the `SHAPE_PCM_INFINITE_LOOP_COUNT` constant. Start the voice using `SHAPE_SRC_COMMAND_TYPE_START` for the SRC. Let the voice play until you want to stop, either at the end of a loop using `SHAPE_SRC_COMMAND_TYPE_STOP_END` and let the voice play out, or immediately by using `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE`. |
| Finite looping linear PCM | Set the PCM context loop count *loopCount* to \[0, 254]. Start the voice using `SHAPE_SRC_COMMAND_TYPE_START` for the SRC. Let the voice play to the end, or optionally stop it at the end of a loop using `SHAPE_SRC_COMMAND_TYPE_STOP_END` and let the voice play out, or stop it immediately by using `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE`. |
| Circular PCM | Start the voice using `SHAPE_SRC_COMMAND_TYPE_START` for the SRC. Keep streaming data, updating the PCM context write pointer, until you want to stop. Use `SHAPE_SRC_COMMAND_TYPE_STOP_END` to let the SRC play to the current PCM write pointer `loopStartWritePointer`, or `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE` to stop it immediately. |

## Requirements

**Header:** shapepcmcontext.h

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

## See also

[Overview of ACP](https://docs.xbox.com/build/console-features/audio/overviews/acp-overview.md)\
[Overview of Shape](https://docs.xbox.com/build/console-features/audio/overviews/shape-overview.md)\
[shapepcmcontext](https://docs.xbox.com/reference/audio/shapepcmcontext/shapepcmcontext_members.md)


## Related topics

- [ShapePcmContext](https://docs.xbox.com/reference/audio/shapepcmcontext/shapepcmcontext_members.md)
- [GetShapePcmLoopEnd](https://docs.xbox.com/reference/audio/shapepcmcontext/functions/getshapepcmloopend.md)
- [GetShapePcmLoopStartOrWritePointer](https://docs.xbox.com/reference/audio/shapepcmcontext/functions/getshapepcmloopstartorwritepointer.md)
- [SetShapePcmLoopCount](https://docs.xbox.com/reference/audio/shapepcmcontext/functions/setshapepcmloopcount.md)
- [GetShapePcmFormat](https://docs.xbox.com/reference/audio/shapepcmcontext/functions/getshapepcmformat.md)
