HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::AudioFormatInfo Struct Reference

stores the properties of the audio signals More...

#include <AudioFormatInfo.h>

Public Member Functions

 AudioFormatInfo ()
 
 AudioFormatInfo (uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate)
 
 AudioFormatInfo (uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate)
 
 AudioFormatInfo (uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, Heph::Endian endian)
 
 AudioFormatInfo (uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate, Heph::Endian endian)
 
bool operator== (const AudioFormatInfo &rhs) const
 
bool operator!= (const AudioFormatInfo &rhs) const
 
uint16_t FrameSize () const
 
uint32_t ByteRate () const
 

Static Public Member Functions

static uint32_t CalculateBitrate (const AudioFormatInfo &formatInfo)
 

Public Attributes

uint16_t formatTag
 
uint16_t bitsPerSample
 
AudioChannelLayout channelLayout
 stores information about the channel layout.
 
uint32_t sampleRate
 
uint32_t bitRate
 
Heph::Endian endian
 

Detailed Description

stores the properties of the audio signals

Constructor & Destructor Documentation

◆ AudioFormatInfo() [1/5]

HephAudio::AudioFormatInfo::AudioFormatInfo ( )

creates a new instance and initializes it with default values.

◆ AudioFormatInfo() [2/5]

HephAudio::AudioFormatInfo::AudioFormatInfo ( uint16_t formatTag,
uint16_t bitsPerSample,
AudioChannelLayout chLayout,
uint32_t sampleRate )

creates a new instance and initializes it with the provided values.

Parameters
formatTagtag of the format that audio data is encoded with.
bitsPerSamplebit depth, the number of bits required to represent a sample.
chLayoutstores information about the channel layout.
sampleRatesamples per second, the number of samples required to represent a one-second-long audio signal.

◆ AudioFormatInfo() [3/5]

HephAudio::AudioFormatInfo::AudioFormatInfo ( uint16_t formatTag,
uint16_t bitsPerSample,
AudioChannelLayout chLayout,
uint32_t sampleRate,
uint32_t bitRate )

creates a new instance and initializes it with the provided values.

Parameters
formatTagtag of the format that audio data is encoded with.
bitsPerSamplebit depth, the number of bits required to represent a sample.
chLayoutstores information about the channel layout.
sampleRatesamples per second, the number of samples required to represent a one-second-long audio signal.
bitRatebits per second, the number of bits required to represent a one-second-long audio signal.

◆ AudioFormatInfo() [4/5]

HephAudio::AudioFormatInfo::AudioFormatInfo ( uint16_t formatTag,
uint16_t bitsPerSample,
AudioChannelLayout chLayout,
uint32_t sampleRate,
Heph::Endian endian )

creates a new instance and initializes it with the provided values.

Parameters
formatTagtag of the format that audio data is encoded with.
bitsPerSamplebit depth, the number of bits required to represent a sample.
chLayoutstores information about the channel layout.
sampleRatesamples per second, the number of samples required to represent a one-second-long audio signal.
endianendianness of the audio samples.

◆ AudioFormatInfo() [5/5]

HephAudio::AudioFormatInfo::AudioFormatInfo ( uint16_t formatTag,
uint16_t bitsPerSample,
AudioChannelLayout chLayout,
uint32_t sampleRate,
uint32_t bitRate,
Heph::Endian endian )

creates a new instance and initializes it with the provided values.

Parameters
formatTagtag of the format that audio data is encoded with.
bitsPerSamplebit depth, the number of bits required to represent a sample.
chLayoutstores information about the channel layout.
sampleRatesamples per second, the number of samples required to represent a one-second-long audio signal.
bitRatebits per second, the number of bits required to represent a one-second-long audio signal.
endianendianness of the audio samples.

Member Function Documentation

◆ FrameSize()

uint16_t HephAudio::AudioFormatInfo::FrameSize ( ) const

calculates the size of an audio frame in bytes.

◆ ByteRate()

uint32_t HephAudio::AudioFormatInfo::ByteRate ( ) const

calculates the number of bytes required to represent a one-second-long audio signal.

◆ CalculateBitrate()

static uint32_t HephAudio::AudioFormatInfo::CalculateBitrate ( const AudioFormatInfo & formatInfo)
static

calculates the bitrate of the PCM, IEEE_FLOAT, ALAW, and MULAW codecs.

Member Data Documentation

◆ formatTag

uint16_t HephAudio::AudioFormatInfo::formatTag

tag of the format that audio data is encoded with.

◆ bitsPerSample

uint16_t HephAudio::AudioFormatInfo::bitsPerSample

bit depth, the number of bits required to represent a sample.

◆ channelLayout

AudioChannelLayout HephAudio::AudioFormatInfo::channelLayout

stores information about the channel layout.

◆ sampleRate

uint32_t HephAudio::AudioFormatInfo::sampleRate

samples per second, the number of samples required to represent a one-second-long audio signal.

◆ bitRate

uint32_t HephAudio::AudioFormatInfo::bitRate

bits per second, the number of bits required to represent a one-second-long audio signal.

◆ endian

Heph::Endian HephAudio::AudioFormatInfo::endian

endianness of the audio samples.