blip  0.1
AudioFormat Class Reference

An object that describes an audio data format. More...

#include <AudioFormat.hpp>

Public Types

enum  Format { Format_None = 0, Format_PCM }
 Audio format types. More...
 

Public Member Functions

 AudioFormat ()
 Construct a new, ininitialized AudioFormat object. More...
 
 AudioFormat (Format format, uint32_t sampleRate, uint16_t bitsPerSample, uint16_t numChannels) throw ()
 Construct a new AudioFormat object with the given format parameters. More...
 
 ~AudioFormat () throw ()
 Destructor. More...
 
Format getFormat () const throw ()
 Get the format type. More...
 
uint32_t getSampleRate () const throw ()
 Get the sample rate, in Hz. More...
 
uint16_t getBitsPerSample () const throw ()
 Get the number of data bits per sample. More...
 
uint16_t getNumChannels () const throw ()
 Get the number of discrete audio channels. More...
 
bool isMono () const throw ()
 Test if this is single-channel (mono) audio. More...
 
bool isStereo () const throw ()
 Test if this is dual-channel (stereo) audio. More...
 
size_t getBytesPerSample () const throw ()
 Get the number of data bytes per sample. More...
 
bool isValid () const throw ()
 Test if this AudioFormat is valid. More...
 
bool operator== (const AudioFormat &other) const throw ()
 Equality operator. More...
 
bool operator!= (const AudioFormat &other) const throw ()
 Inequality operator. More...
 

Detailed Description

An object that describes an audio data format.

Author
Mark Lindner

Member Enumeration Documentation

◆ Format

enum Format

Audio format types.

Enumerator
Format_None 
Format_PCM 

Constructor & Destructor Documentation

◆ AudioFormat() [1/2]

Construct a new, ininitialized AudioFormat object.

◆ AudioFormat() [2/2]

AudioFormat ( Format  format,
uint32_t  sampleRate,
uint16_t  bitsPerSample,
uint16_t  numChannels 
)
throw (
)

Construct a new AudioFormat object with the given format parameters.

Parameters
formatThe format type.
sampleRateThe sample rate, in Hz.
bitsPerSampleThe number of data bits per sample.
numChannelsThe number of discrete audio channels.

◆ ~AudioFormat()

~AudioFormat ( )
throw (
)

Destructor.

Member Function Documentation

◆ getBitsPerSample()

uint16_t getBitsPerSample ( ) const
throw (
)
inline

Get the number of data bits per sample.

◆ getBytesPerSample()

size_t getBytesPerSample ( ) const
throw (
)

Get the number of data bytes per sample.

◆ getFormat()

Format getFormat ( ) const
throw (
)
inline

Get the format type.

◆ getNumChannels()

uint16_t getNumChannels ( ) const
throw (
)
inline

Get the number of discrete audio channels.

◆ getSampleRate()

uint32_t getSampleRate ( ) const
throw (
)
inline

Get the sample rate, in Hz.

◆ isMono()

bool isMono ( ) const
throw (
)
inline

Test if this is single-channel (mono) audio.

◆ isStereo()

bool isStereo ( ) const
throw (
)
inline

Test if this is dual-channel (stereo) audio.

◆ isValid()

bool isValid ( ) const
throw (
)

Test if this AudioFormat is valid.

◆ operator!=()

bool operator!= ( const AudioFormat other) const
throw (
)
inline

Inequality operator.

◆ operator==()

bool operator== ( const AudioFormat other) const
throw (
)

Equality operator.


The documentation for this class was generated from the following files: