MPD: pcm/SampleFormat.hxx File Reference

MPD 0.20.18

Enumerations | Functions
SampleFormat.hxx File Reference
`#include "Compiler.h"`
`#include <stdint.h>`
Include dependency graph for SampleFormat.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Enumerations
enum | SampleFormat : uint8_t { SampleFormat::UNDEFINED = 0, SampleFormat::S8, SampleFormat::S16, SampleFormat::S24_P32, SampleFormat::S32, SampleFormat::FLOAT, SampleFormat::DSD }

## Functions
static constexpr bool | audio_valid_sample_format (SampleFormat format)
| Checks whether the sample format is valid. More...
static constexpr unsigned | sample_format_size (SampleFormat format)
gcc_pure const char * | sample_format_to_string (SampleFormat format) noexcept
| Renders a SampleFormat enum into a string, e.g. More...

## Enumeration Type Documentation

## ◆ SampleFormat

enum SampleFormat : uint8_t
| strong

Enumerator
UNDEFINED |
S8 |
S16 |
S24_P32 | Signed 24 bit integer samples, packed in 32 bit integers (the most significant byte is filled with the sign bit).
S32 |
FLOAT | 32 bit floating point samples in the host's format. The range is -1.0f to +1.0f.
DSD | Direct Stream Digital. 1-bit samples; each frame has one byte (8 samples) per channel.

Definition at line 33 of file SampleFormat.hxx.

## Function Documentation

## ◆ audio_valid_sample_format()

static constexpr bool audio_valid_sample_format | ( | SampleFormat | format | ) |
| inlinestatic

Checks whether the sample format is valid.

Definition at line 71 of file SampleFormat.hxx.

## ◆ sample_format_size()

static constexpr unsigned sample_format_size | ( | SampleFormat | format | ) |
| inlinestatic

Definition at line 93 of file SampleFormat.hxx.

## ◆ sample_format_to_string()

gcc_pure const char* sample_format_to_string | ( | SampleFormat | format | ) |
| noexcept

Renders a SampleFormat enum into a string, e.g.

for printing it in a log file.

Parameters

  format | a SampleFormat enum value

Returns
  the string