URY playd
C++ minimalist audio player
sample_formats.hpp File Reference

The SampleFormat enumeration and related declarations. More...

#include <array>
#include <cstdint>
+ Include dependency graph for sample_formats.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  SampleFormat : std::uint8_t {
  SampleFormat::PACKED_UNSIGNED_INT_8, SampleFormat::PACKED_SIGNED_INT_8, SampleFormat::PACKED_SIGNED_INT_16, SampleFormat::PACKED_SIGNED_INT_32,
  SampleFormat::PACKED_FLOAT_32
}
 Sample formats available in playd. More...
 

Variables

constexpr std::size_t SAMPLE_FORMAT_COUNT = 5
 Number of sample formats available; should agree with SampleFormat.
 
const std::array< std::size_t, SAMPLE_FORMAT_COUNTSAMPLE_FORMAT_BPS
 Map from SampleFormats to bytes-per-mono-sample.
 

Detailed Description

The SampleFormat enumeration and related declarations.

See also
audio/sample_formats.cpp

Definition in file sample_formats.hpp.

Enumeration Type Documentation

§ SampleFormat

enum SampleFormat : std::uint8_t
strong

Sample formats available in playd.

This is the intersection of those sample formats available in the decoders and SDL.

Packed formats are those where each sample contains each audio channel, one packed after the other. Planar formats use separate runs of samples for each channel (each channel has its own sample plane). For the most part, playd deals in the former, resampling instances of the latter.

REMEMBER: changes here will require changes in lookup tables in both sample_formats.cpp and audio_sink.cpp.

Enumerator
PACKED_UNSIGNED_INT_8 

Packed 8-bit unsigned integer.

PACKED_SIGNED_INT_8 

Packed 8-bit signed integer.

PACKED_SIGNED_INT_16 

Packed 16-bit signed integer.

PACKED_SIGNED_INT_32 

Packed 32-bit signed integer.

PACKED_FLOAT_32 

Packed 32-bit floating point.

Definition at line 30 of file sample_formats.hpp.

30  : std::uint8_t {
36 };
Packed 8-bit unsigned integer.
Packed 16-bit signed integer.
Packed 32-bit signed integer.
Packed 8-bit signed integer.
Packed 32-bit floating point.