Audacity 3.2.0
|
FormatClassifier classifies the sample format and endianness of raw audio files. More...
#include <FormatClassifier.h>
Classes | |
struct | FormatClassT |
Public Types | |
typedef std::vector< FormatClassT > | FormatVectorT |
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 |
SpecPowerCalculation | 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 |
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.
Definition at line 56 of file FormatClassifier.h.
typedef std::vector<FormatClassT>::iterator FormatClassifier::FormatVectorIt |
Definition at line 67 of file FormatClassifier.h.
typedef std::vector<FormatClassT> FormatClassifier::FormatVectorT |
Definition at line 66 of file FormatClassifier.h.
FormatClassifier::FormatClassifier | ( | const char * | filename | ) |
Definition at line 31 of file FormatClassifier.cpp.
References MachineEndianness::Big, MultiFormatReader::Double, MultiFormatReader::Float, anonymous_namespace{ExportPCM.cpp}::format, MultiFormatReader::Int16, MultiFormatReader::Int32, MultiFormatReader::Int8, MachineEndianness::Little, mClasses, mMonoFeat, mStereoFeat, Run(), and MultiFormatReader::Uint8.
FormatClassifier::~FormatClassifier | ( | ) |
Definition at line 73 of file FormatClassifier.cpp.
|
private |
Definition at line 293 of file FormatClassifier.cpp.
Referenced by Run().
|
private |
Definition at line 268 of file FormatClassifier.cpp.
Referenced by ReadSignal().
|
private |
Definition at line 237 of file FormatClassifier.cpp.
References cSiglen, MultiFormatReader::Double, MultiFormatReader::Float, anonymous_namespace{ExportPCM.cpp}::format, MultiFormatReader::Int16, MultiFormatReader::Int32, MultiFormatReader::Int8, ToFloat(), MultiFormatReader::Uint16, MultiFormatReader::Uint32, and MultiFormatReader::Uint8.
Referenced by ReadSignal().
|
private |
Definition at line 284 of file FormatClassifier.cpp.
Referenced by Run().
unsigned FormatClassifier::GetResultChannels | ( | ) |
Definition at line 124 of file FormatClassifier.cpp.
References mResultChannels.
Referenced by ImportRawDialog::OnDetect().
FormatClassifier::FormatClassT FormatClassifier::GetResultFormat | ( | ) |
int FormatClassifier::GetResultFormatLibSndfile | ( | ) |
Definition at line 82 of file FormatClassifier.cpp.
References MachineEndianness::Big, MultiFormatReader::Double, FormatClassifier::FormatClassT::endian, MultiFormatReader::Float, anonymous_namespace{ExportPCM.cpp}::format, FormatClassifier::FormatClassT::format, MultiFormatReader::Int16, MultiFormatReader::Int32, MultiFormatReader::Int8, MachineEndianness::Little, mResultFormat, and MultiFormatReader::Uint8.
Referenced by ImportRawDialog::OnDetect().
|
private |
Definition at line 322 of file FormatClassifier.cpp.
References Max().
Referenced by Max(), and Run().
|
private |
Definition at line 328 of file FormatClassifier.cpp.
|
private |
Definition at line 308 of file FormatClassifier.cpp.
Referenced by Run().
|
private |
Definition at line 199 of file FormatClassifier.cpp.
References Add(), cNumInts, ConvertSamples(), cSiglen, anonymous_namespace{ExportPCM.cpp}::format, MachineEndianness::Little, mAuxBuffer, mRawBuffer, mReader, mSigBuffer, MultiFormatReader::ReadSamples(), MultiFormatReader::Reset(), and MultiFormatReader::Uint8.
Referenced by Run().
|
private |
Definition at line 129 of file FormatClassifier.cpp.
References Abs(), SpecPowerCalculation::CalcPower(), cSiglen, Div(), mAuxBuffer, Max(), mClasses, Mean(), mMeter, mMonoFeat, mResultChannels, mResultFormat, mSigBuffer, mStereoFeat, ReadSignal(), and Sub().
Referenced by FormatClassifier().
|
private |
Definition at line 276 of file FormatClassifier.cpp.
Referenced by Run().
|
private |
Definition at line 345 of file FormatClassifier.cpp.
Referenced by ConvertSamples().
|
staticprivate |
Definition at line 72 of file FormatClassifier.h.
Referenced by ReadSignal().
|
staticprivate |
Definition at line 71 of file FormatClassifier.h.
Referenced by ConvertSamples(), ReadSignal(), and Run().
Definition at line 83 of file FormatClassifier.h.
Referenced by ReadSignal(), and Run().
|
private |
Definition at line 74 of file FormatClassifier.h.
Referenced by FormatClassifier(), and Run().
|
private |
Definition at line 76 of file FormatClassifier.h.
Referenced by Run().
|
private |
Definition at line 86 of file FormatClassifier.h.
Referenced by FormatClassifier(), and Run().
Definition at line 84 of file FormatClassifier.h.
Referenced by ReadSignal().
|
private |
Definition at line 75 of file FormatClassifier.h.
Referenced by ReadSignal().
|
private |
Definition at line 90 of file FormatClassifier.h.
Referenced by GetResultChannels(), and Run().
|
private |
Definition at line 89 of file FormatClassifier.h.
Referenced by GetResultFormat(), GetResultFormatLibSndfile(), and Run().
Definition at line 82 of file FormatClassifier.h.
Referenced by ReadSignal(), and Run().
|
private |
Definition at line 87 of file FormatClassifier.h.
Referenced by FormatClassifier(), and Run().