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