VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
vrs::AudioContentBlockSpec Class Reference

Specification of an audio content block. More...

#include <RecordFormat.h>

Public Member Functions

 AudioContentBlockSpec (const AudioContentBlockSpec &)=default
 Default copy constructor.
 
 AudioContentBlockSpec (AudioFormat audioFormat, uint8_t channelCount=0)
 For audio formats with encoding (mp3, flac, etc).
 
 AudioContentBlockSpec (AudioFormat audioFormat, AudioSampleFormat sampleFormat, uint8_t channelCount=0, uint8_t sampleFrameStride=0, uint32_t sampleFrameRate=0, uint32_t sampleFrameCount=0, uint8_t stereoPairCount=0)
 
 AudioContentBlockSpec (const string &formatStr)
 
void set (ContentParser &parser)
 
void clear ()
 Clear/reset object to default values.
 
string asString () const
 
size_t getBlockSize () const
 Get the number of bytes for this content block, or ContentBlock::kSizeUnknown.
 
size_t getPcmBlockSize () const
 Assuming PCM, get the number of bytes for this content block, or ContentBlock::kSizeUnknown.
 
AudioContentBlockSpecoperator= (const AudioContentBlockSpec &)=default
 Default copy assignment.
 
bool operator== (const AudioContentBlockSpec &rhs) const
 Compare two audio block spec.
 
bool operator!= (const AudioContentBlockSpec &rhs) const
 
bool isCompatibleWith (const AudioContentBlockSpec &rhs) const
 Tell if two audio block have identical audio formats.
 
AudioFormat getAudioFormat () const
 Get audio format.
 
AudioSampleFormat getSampleFormat () const
 Get audio sample format.
 
string getSampleFormatAsString () const
 Get audio sample format as a string.
 
bool isLittleEndian () const
 Tell if the audio sample format is little endian.
 
bool isIEEEFloat () const
 Tell if the audio sample format is an IEEE float.
 
uint8_t getBitsPerSample () const
 Get the number of bits per audio sample.
 
uint8_t getBytesPerSample () const
 Get the number of bytes per audio sample.
 
uint8_t getSampleFrameStride () const
 Number of bytes used by a group of synchronous audio samples, including padding.
 
uint8_t getChannelCount () const
 Get the number of audio channels in each sample frame (not in the content block).
 
uint32_t getSampleRate () const
 Get the audio frame sample rate.
 
uint32_t getSampleCount () const
 Get the number of audio sample frames in the content block.
 
void setSampleCount (uint32_t sampleCount)
 Set the number of audio sample frames in the content block.
 
uint8_t getStereoPairCount () const
 
bool isSampleBlockFormatDefined () const
 

Static Public Member Functions

static bool isLittleEndian (AudioSampleFormat sampleFormat)
 Tell if a specific audio sample format is little endian.
 
static bool isIEEEFloat (AudioSampleFormat sampleFormat)
 Tell if a specific audio sample format is an IEEE float.
 
static uint8_t getBitsPerSample (AudioSampleFormat sampleFormat)
 Get the number of bits per audio sample for a specific audio sample format.
 
static uint8_t getBytesPerSample (AudioSampleFormat sampleFormat)
 Get the number of bytes per audio sample for a specific audio sample format.
 
static string getSampleFormatAsString (AudioSampleFormat sampleFormat)
 Get an audio sample format as a string.
 

Detailed Description

Specification of an audio content block.

Constructor & Destructor Documentation

◆ AudioContentBlockSpec()

vrs::AudioContentBlockSpec::AudioContentBlockSpec ( const string &  formatStr)
explicit

Constructor used for factory construction.

Member Function Documentation

◆ asString()

string vrs::AudioContentBlockSpec::asString ( ) const

Convert to string, to store on disk & reconstruct later using factory constructor.

◆ isSampleBlockFormatDefined()

bool vrs::AudioContentBlockSpec::isSampleBlockFormatDefined ( ) const

Tell if the audio sample format is fully defined. For instance, PCM audio data when we have enough details: sample format & channel count.

◆ set()

void vrs::AudioContentBlockSpec::set ( ContentParser parser)

when constructing from a string.


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