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

# SetShapePcmFormat

> SetShapePcmFormat

# SetShapePcmFormat

Establece el formato PCM.

## Sintaxis

```cpp theme={null}
HRESULT SetShapePcmFormat(  
         SHAPE_PCM_CONTEXT* context,  
         SHAPE_PCM_FORMAT format  
)  
```

### Parámetros

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

Puntero a una estructura [SHAPE\_PCM\_CONTEXT](/reference/audio/shapepcmcontext/structs/shape_pcm_context).

*format*   \
Tipo: [SHAPE\_PCM\_FORMAT](/reference/audio/shapepcmcontext/enums/shape_pcm_format)

Un miembro de la enumeración [SHAPE\_PCM\_FORMAT](/reference/audio/shapepcmcontext/enums/shape_pcm_format).

### Valor devuelto

Tipo: HRESULT

Código HRESULT de éxito o de error.

## Comentarios

| Función                       | Descripción                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PCM lineal sin bucle          | Inicie la voz con la constante `SHAPE_SRC_COMMAND_TYPE_START` para el convertidor de frecuencia de muestreo (SRC). Deje que la voz se reproduzca hasta el final o, si lo desea, deténgala antes del final con la constante `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE`. Para obtener más información, consulte la enumeración  [SHAPE\_SRC\_COMMAND\_TYPE](/reference/audio/shapesrccontext/enums/shape_src_command_type). |
| PCM lineal con bucle infinito | Establezca el recuento de bucles del contexto de PCM *loopCount* en la constante `SHAPE_PCM_INFINITE_LOOP_COUNT`. Inicie la voz con `SHAPE_SRC_COMMAND_TYPE_START` para el SRC. Deje que la voz se reproduzca hasta que quiera detenerla, ya sea al final de un bucle con `SHAPE_SRC_COMMAND_TYPE_STOP_END`, dejando que la voz termine de reproducirse, o inmediatamente con `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE`. |
| PCM lineal con bucle finito   | Establezca el recuento de bucles del contexto de PCM *loopCount* en \[0, 254]. Inicie la voz con `SHAPE_SRC_COMMAND_TYPE_START` para el SRC. Deje que la voz se reproduzca hasta el final o, si lo desea, deténgala al final de un bucle con `SHAPE_SRC_COMMAND_TYPE_STOP_END`, dejando que la voz termine de reproducirse, o deténgala inmediatamente con `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE`.                    |
| PCM circular                  | Inicie la voz con `SHAPE_SRC_COMMAND_TYPE_START` para el SRC. Siga transmitiendo datos y actualizando el puntero de escritura del contexto de PCM hasta que quiera detenerla. Use `SHAPE_SRC_COMMAND_TYPE_STOP_END` para dejar que el SRC reproduzca hasta el puntero de escritura de PCM actual `loopStartWritePointer`, o `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE` para detenerla inmediatamente.                     |

Formatos de las muestras de entrada:\\

<img src="https://mintcdn.com/microsoft-4404708b/gzrdvT5kpqAXKEQt/images/gdk/reference/pcm_format.png?fit=max&auto=format&n=gzrdvT5kpqAXKEQt&q=85&s=58f4b6bb7fadd542a8c9a337cd729ba2" alt="Diagrama que muestra las asignaciones de bits de cada uno de los cuatro formatos de muestra de entrada PCM admitidos." width="740" height="357" data-path="images/gdk/reference/pcm_format.png" />

## Requisitos

**Encabezado:** shapepcmcontext.h

**Plataformas compatibles:** consolas de la familia XBOX One y consolas XBOX Series

## Consulte también

[Información general sobre ACP](/build/console-features/audio/overviews/acp-overview)\
[Información general de SHAPE](/build/console-features/audio/overviews/shape-overview)\
[shapepcmcontext](/reference/audio/shapepcmcontext/shapepcmcontext_members)


## Related topics

- [ShapePcmContext](/es/reference/audio/shapepcmcontext/shapepcmcontext_members.md)
- [SHAPE_PCM_FORMAT](/es/reference/audio/shapepcmcontext/enums/shape_pcm_format.md)
- [GetShapePcmFormat](/es/reference/audio/shapepcmcontext/functions/getshapepcmformat.md)
- [SetShapePcmMode](/es/reference/audio/shapepcmcontext/functions/setshapepcmmode.md)
- [SetShapePcmLoopEnd](/es/reference/audio/shapepcmcontext/functions/setshapepcmloopend.md)
