MPD: pcm/PcmFormat.hxx File Reference

MPD 0.20.18

Data Structures | Functions
PcmFormat.hxx File Reference
`#include "SampleFormat.hxx"`
`#include <stdint.h>`
Include dependency graph for PcmFormat.hxx:

Go to the source code of this file.

## Data Structures
struct | ConstBuffer< T >
| A reference to a memory area that is read-only. More...

## Functions
gcc_pure ConstBuffer< int16_t > | pcm_convert_to_16 (PcmBuffer &buffer, PcmDither &dither, SampleFormat src_format, ConstBuffer< void > src) noexcept
| Converts PCM samples to 16 bit. More...
gcc_pure ConstBuffer< int32_t > | pcm_convert_to_24 (PcmBuffer &buffer, SampleFormat src_format, ConstBuffer< void > src) noexcept
| Converts PCM samples to 24 bit (32 bit alignment). More...
gcc_pure ConstBuffer< int32_t > | pcm_convert_to_32 (PcmBuffer &buffer, SampleFormat src_format, ConstBuffer< void > src) noexcept
| Converts PCM samples to 32 bit. More...
gcc_pure ConstBuffer< float > | pcm_convert_to_float (PcmBuffer &buffer, SampleFormat src_format, ConstBuffer< void > src) noexcept
| Converts PCM samples to 32 bit floating point. More...

## Function Documentation

## ◆ pcm_convert_to_16()

gcc_pure ConstBuffer<int16_t> pcm_convert_to_16 | ( | PcmBuffer & | buffer,
|  | PcmDither & | dither,
|  | SampleFormat | src_format,
|  | ConstBuffer< void > | src
| ) |  |
| noexcept

Converts PCM samples to 16 bit.

If the source format is 24 bit, then dithering is applied.

Parameters

  buffer | a PcmBuffer object
  dither | a PcmDither object for 24-to-16 conversion
  src | the source PCM buffer

Returns
  the destination buffer

## ◆ pcm_convert_to_24()

gcc_pure ConstBuffer<int32_t> pcm_convert_to_24 | ( | PcmBuffer & | buffer,
|  | SampleFormat | src_format,
|  | ConstBuffer< void > | src
| ) |  |
| noexcept

Converts PCM samples to 24 bit (32 bit alignment).

Parameters

  buffer | a PcmBuffer object
  src | the source PCM buffer

Returns
  the destination buffer

## ◆ pcm_convert_to_32()

gcc_pure ConstBuffer<int32_t> pcm_convert_to_32 | ( | PcmBuffer & | buffer,
|  | SampleFormat | src_format,
|  | ConstBuffer< void > | src
| ) |  |
| noexcept

Converts PCM samples to 32 bit.

Parameters

  buffer | a PcmBuffer object
  src | the source PCM buffer

Returns
  the destination buffer

## ◆ pcm_convert_to_float()

gcc_pure ConstBuffer<float> pcm_convert_to_float | ( | PcmBuffer & | buffer,
|  | SampleFormat | src_format,
|  | ConstBuffer< void > | src
| ) |  |
| noexcept

Converts PCM samples to 32 bit floating point.

Parameters

  buffer | a PcmBuffer object
  src | the source PCM buffer

Returns
  the destination buffer