11#ifndef __AUDACITY_FORMATCLASSIFIER_H_
12#define __AUDACITY_FORMATCLASSIFIER_H_
21#error Requires libsndfile 1.0.3 or higher
26#ifdef FORMATCLASSIFIER_SIGNAL_DEBUG
33 DebugWriter(
const char* filename)
35 mpFid = fopen(filename,
"wb");
40 if (mpFid) fclose(mpFid);
43 void WriteSignal(
float* buffer,
size_t len)
45 WriteSignal(buffer, 4, len);
48 void WriteSignal(
void* buffer,
size_t size,
size_t len)
50 fwrite(buffer,
size, len, mpFid);
78#ifdef FORMATCLASSIFIER_SIGNAL_DEBUG
79 std::unique_ptr<DebugWriter> mpWriter;
104 void Add(
float* in1,
float* in2,
size_t len);
105 void Sub(
float* in,
float subt,
size_t len);
106 void Div(
float* in,
float div,
size_t len);
107 void Abs(
float* in,
float* out,
size_t len);
108 float Mean(
float* in,
size_t len);
109 float Max(
float* in,
size_t len);
110 float Max(
float* in,
size_t len,
size_t* maxidx);
112 template<
class T>
void ToFloat(T* in,
float* out,
size_t len);
SpecPowerCalculation is a simple spectral power level meter.