Audacity  2.2.0
FormatClassifier Class Reference

FormatClassifier classifies the sample format and endianness of raw audio files. More...

#include <FormatClassifier.h>

Classes

struct  FormatClassT
 

Public Types

typedef std::vector< FormatClassTFormatVectorT
 
typedef std::vector
< FormatClassT >::iterator 
FormatVectorIt
 

Public Member Functions

 FormatClassifier (const char *filename)
 
 ~FormatClassifier ()
 
FormatClassT GetResultFormat ()
 
int GetResultFormatLibSndfile ()
 
unsigned GetResultChannels ()
 

Private Member Functions

void Run ()
 
void ReadSignal (FormatClassT format, size_t stride)
 
void ConvertSamples (void *in, float *out, FormatClassT format)
 
void Add (float *in1, float *in2, size_t len)
 
void Sub (float *in, float subt, size_t len)
 
void Div (float *in, float div, size_t len)
 
void Abs (float *in, float *out, size_t len)
 
float Mean (float *in, size_t len)
 
float Max (float *in, size_t len)
 
float Max (float *in, size_t len, size_t *maxidx)
 
template<class T >
void ToFloat (T *in, float *out, size_t len)
 

Private Attributes

FormatVectorT mClasses
 
MultiFormatReader mReader
 
SpecPowerMeter mMeter
 
Floats mSigBuffer { cSiglen }
 
Floats mAuxBuffer { cSiglen }
 
ArrayOf< uint8_t > mRawBuffer { cSiglen * 8 }
 
Floats mMonoFeat
 
Floats mStereoFeat
 
FormatClassT mResultFormat
 
unsigned mResultChannels { 0 }
 

Static Private Attributes

static const size_t cSiglen = 512
 
static const size_t cNumInts = 32
 

Detailed Description

FormatClassifier classifies the sample format and endianness of raw audio files.

The classifier operates in the frequency domain and exploits the low-pass-like spectral behaviour of natural audio signals for classification of the sample format and the used endianness.

Member Typedef Documentation

typedef std::vector<FormatClassT>::iterator FormatClassifier::FormatVectorIt

Constructor & Destructor Documentation

FormatClassifier::~FormatClassifier ( )

Member Function Documentation

void FormatClassifier::Abs ( float *  in,
float *  out,
size_t  len 
)
private

Referenced by Run().

void FormatClassifier::Add ( float *  in1,
float *  in2,
size_t  len 
)
private

Referenced by ReadSignal().

void FormatClassifier::Div ( float *  in,
float  div,
size_t  len 
)
private

Referenced by Run().

unsigned FormatClassifier::GetResultChannels ( )

References mResultChannels.

FormatClassifier::FormatClassT FormatClassifier::GetResultFormat ( )

References mResultFormat.

float FormatClassifier::Max ( float *  in,
size_t  len 
)
private

Referenced by Run().

float FormatClassifier::Max ( float *  in,
size_t  len,
size_t *  maxidx 
)
private
float FormatClassifier::Mean ( float *  in,
size_t  len 
)
private

Referenced by Run().

void FormatClassifier::Sub ( float *  in,
float  subt,
size_t  len 
)
private

Referenced by Run().

template<class T >
void FormatClassifier::ToFloat ( T *  in,
float *  out,
size_t  len 
)
private

Referenced by ConvertSamples().

Member Data Documentation

const size_t FormatClassifier::cNumInts = 32
staticprivate

Referenced by ReadSignal().

const size_t FormatClassifier::cSiglen = 512
staticprivate

Referenced by ConvertSamples(), ReadSignal(), and Run().

Floats FormatClassifier::mAuxBuffer { cSiglen }
private

Referenced by ReadSignal(), and Run().

FormatVectorT FormatClassifier::mClasses
private

Referenced by FormatClassifier(), and Run().

SpecPowerMeter FormatClassifier::mMeter
private

Referenced by Run().

Floats FormatClassifier::mMonoFeat
private

Referenced by FormatClassifier(), and Run().

ArrayOf<uint8_t> FormatClassifier::mRawBuffer { cSiglen * 8 }
private

Referenced by ReadSignal().

MultiFormatReader FormatClassifier::mReader
private

Referenced by ReadSignal().

unsigned FormatClassifier::mResultChannels { 0 }
private

Referenced by GetResultChannels(), and Run().

FormatClassT FormatClassifier::mResultFormat
private
Floats FormatClassifier::mSigBuffer { cSiglen }
private

Referenced by ReadSignal(), and Run().

Floats FormatClassifier::mStereoFeat
private

Referenced by FormatClassifier(), and Run().


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