Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::AudioFormat Struct Reference

Structure to hold sample rate and channel number associated with audio data. More...

#include <audio_format.h>

Collaboration diagram for jami::AudioFormat:
Collaboration graph

Public Member Functions

constexpr AudioFormat (unsigned sr, unsigned c, AVSampleFormat f=AV_SAMPLE_FMT_S16)
 
size_t getBandwidth (unsigned delay_ms=1000) const
 Bytes per second (default), or bytes necessary to hold delay_ms milliseconds of audio data.
 
size_t getBytesPerFrame () const
 Returns bytes necessary to hold one frame of audio data.
 
bool operator!= (const AudioFormat &b) const
 
bool operator== (const AudioFormat &b) const
 
std::string toString () const
 
AudioFormat withSampleFormat (AVSampleFormat format)
 

Static Public Member Functions

static const constexpr AudioFormat DEFAULT ()
 
static const constexpr AudioFormat MONO ()
 
static const constexpr AudioFormat NONE ()
 
static const constexpr AudioFormat STEREO ()
 

Public Attributes

unsigned nb_channels
 
unsigned sample_rate
 
AVSampleFormat sampleFormat
 

Static Public Attributes

static const constexpr unsigned DEFAULT_SAMPLE_RATE = 48000
 

Detailed Description

Structure to hold sample rate and channel number associated with audio data.

Definition at line 33 of file audio_format.h.

Constructor & Destructor Documentation

◆ AudioFormat()

constexpr jami::AudioFormat::AudioFormat ( unsigned  sr,
unsigned  c,
AVSampleFormat  f = AV_SAMPLE_FMT_S16 
)
inlineconstexpr

Definition at line 39 of file audio_format.h.

Member Function Documentation

◆ DEFAULT()

static const constexpr AudioFormat jami::AudioFormat::DEFAULT ( )
inlinestaticconstexpr

Definition at line 79 of file audio_format.h.

◆ getBandwidth()

size_t jami::AudioFormat::getBandwidth ( unsigned  delay_ms = 1000) const
inline

Bytes per second (default), or bytes necessary to hold delay_ms milliseconds of audio data.

Definition at line 73 of file audio_format.h.

References jami::emitSignal(), getBytesPerFrame(), and sample_rate.

Here is the call graph for this function:

◆ getBytesPerFrame()

size_t jami::AudioFormat::getBytesPerFrame ( ) const
inline

Returns bytes necessary to hold one frame of audio data.

Definition at line 67 of file audio_format.h.

References jami::emitSignal(), nb_channels, and sampleFormat.

Referenced by getBandwidth(), jami::OpenSLLayer::initAudioEngine(), and jami::OpenSLLayer::startAudioCapture().

Here is the call graph for this function:

◆ MONO()

static const constexpr AudioFormat jami::AudioFormat::MONO ( )
inlinestaticconstexpr

Definition at line 81 of file audio_format.h.

References DEFAULT_SAMPLE_RATE.

◆ NONE()

static const constexpr AudioFormat jami::AudioFormat::NONE ( )
inlinestaticconstexpr

Definition at line 80 of file audio_format.h.

◆ operator!=()

bool jami::AudioFormat::operator!= ( const AudioFormat b) const
inline

Definition at line 51 of file audio_format.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator==()

bool jami::AudioFormat::operator== ( const AudioFormat b) const
inline

Definition at line 45 of file audio_format.h.

References jami::emitSignal(), nb_channels, sample_rate, and sampleFormat.

Here is the call graph for this function:

◆ STEREO()

static const constexpr AudioFormat jami::AudioFormat::STEREO ( )
inlinestaticconstexpr

Definition at line 82 of file audio_format.h.

References DEFAULT_SAMPLE_RATE.

Referenced by jami::LocalRecorder::startRecording().

◆ toString()

◆ withSampleFormat()

AudioFormat jami::AudioFormat::withSampleFormat ( AVSampleFormat  format)
inline

Definition at line 58 of file audio_format.h.

References nb_channels, and sample_rate.

Member Data Documentation

◆ DEFAULT_SAMPLE_RATE

const constexpr unsigned jami::AudioFormat::DEFAULT_SAMPLE_RATE = 48000
staticconstexpr

Definition at line 78 of file audio_format.h.

Referenced by MONO(), and STEREO().

◆ nb_channels

◆ sample_rate

◆ sampleFormat


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