RAVENNAKIT
Loading...
Searching...
No Matches
rav::AudioFormat Struct Reference

#include <audio_format.hpp>

Public Types

enum class  ByteOrder : uint8_t { le , be }
enum class  ChannelOrdering : uint8_t { interleaved , noninterleaved }

Public Member Functions

uint8_t bytes_per_sample () const
uint32_t bytes_per_frame () const
uint8_t ground_value () const
std::string to_string () const
bool is_valid () const
auto tie () const
bool operator== (const AudioFormat &other) const
bool operator!= (const AudioFormat &other) const
bool is_native_byte_order () const
AudioFormat with_byte_order (const ByteOrder order) const

Static Public Member Functions

static const char * to_string (const ByteOrder order)
static const char * to_string (const ChannelOrdering order)
static std::optional< ByteOrder > byte_order_from_string (const std::string &str)
static std::optional< ChannelOrdering > channel_ordering_from_string (const std::string &str)

Public Attributes

ByteOrder byte_order {little_endian ? ByteOrder::le : ByteOrder::be}
AudioEncoding encoding {}
ChannelOrdering ordering {ChannelOrdering::interleaved}
uint32_t sample_rate {}
uint32_t num_channels {}

Detailed Description

Definition at line 37 of file audio_format.hpp.

Member Enumeration Documentation

◆ ByteOrder

enum class rav::AudioFormat::ByteOrder : uint8_t
strong
Enumerator
le 
be 

Definition at line 38 of file audio_format.hpp.

◆ ChannelOrdering

enum class rav::AudioFormat::ChannelOrdering : uint8_t
strong
Enumerator
interleaved 
noninterleaved 

Definition at line 43 of file audio_format.hpp.

Member Function Documentation

◆ byte_order_from_string()

std::optional< ByteOrder > rav::AudioFormat::byte_order_from_string ( const std::string & str)
inlinestatic

Definition at line 100 of file audio_format.hpp.

◆ bytes_per_frame()

uint32_t rav::AudioFormat::bytes_per_frame ( ) const
inlinenodiscard

Definition at line 58 of file audio_format.hpp.

◆ bytes_per_sample()

uint8_t rav::AudioFormat::bytes_per_sample ( ) const
inlinenodiscard

Definition at line 54 of file audio_format.hpp.

◆ channel_ordering_from_string()

std::optional< ChannelOrdering > rav::AudioFormat::channel_ordering_from_string ( const std::string & str)
inlinestatic

Definition at line 110 of file audio_format.hpp.

◆ ground_value()

uint8_t rav::AudioFormat::ground_value ( ) const
inlinenodiscard

Definition at line 62 of file audio_format.hpp.

◆ is_native_byte_order()

bool rav::AudioFormat::is_native_byte_order ( ) const
inlinenodiscard

Definition at line 88 of file audio_format.hpp.

◆ is_valid()

bool rav::AudioFormat::is_valid ( ) const
inlinenodiscard

Definition at line 72 of file audio_format.hpp.

◆ operator!=()

bool rav::AudioFormat::operator!= ( const AudioFormat & other) const
inline

Definition at line 84 of file audio_format.hpp.

◆ operator==()

bool rav::AudioFormat::operator== ( const AudioFormat & other) const
inline

Definition at line 80 of file audio_format.hpp.

◆ tie()

auto rav::AudioFormat::tie ( ) const
inlinenodiscard

Definition at line 76 of file audio_format.hpp.

◆ to_string() [1/3]

std::string rav::AudioFormat::to_string ( ) const
inlinenodiscard

Definition at line 66 of file audio_format.hpp.

◆ to_string() [2/3]

const char * rav::AudioFormat::to_string ( const ByteOrder order)
inlinestatic

Definition at line 92 of file audio_format.hpp.

◆ to_string() [3/3]

const char * rav::AudioFormat::to_string ( const ChannelOrdering order)
inlinestatic

Definition at line 96 of file audio_format.hpp.

◆ with_byte_order()

AudioFormat rav::AudioFormat::with_byte_order ( const ByteOrder order) const
inlinenodiscard
Parameters
orderThe byte order to set.
Returns
A copy of this AudioFormat with the byte order set to the given value.

Definition at line 124 of file audio_format.hpp.

Member Data Documentation

◆ byte_order

ByteOrder rav::AudioFormat::byte_order {little_endian ? ByteOrder::le : ByteOrder::be}

Definition at line 48 of file audio_format.hpp.

◆ encoding

AudioEncoding rav::AudioFormat::encoding {}

Definition at line 49 of file audio_format.hpp.

◆ num_channels

uint32_t rav::AudioFormat::num_channels {}

Definition at line 52 of file audio_format.hpp.

◆ ordering

ChannelOrdering rav::AudioFormat::ordering {ChannelOrdering::interleaved}

Definition at line 50 of file audio_format.hpp.

◆ sample_rate

uint32_t rav::AudioFormat::sample_rate {}

Definition at line 51 of file audio_format.hpp.


The documentation for this struct was generated from the following file: