2019-03-15 12:58:30 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
class WaveRecorder
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::ofstream _stream;
|
|
|
|
uint32_t _streamSize;
|
|
|
|
uint32_t _sampleRate;
|
|
|
|
bool _isStereo;
|
|
|
|
string _outputFile;
|
|
|
|
|
|
|
|
void WriteHeader();
|
|
|
|
void UpdateSizeValues();
|
|
|
|
void CloseFile();
|
|
|
|
|
|
|
|
public:
|
|
|
|
WaveRecorder(string outputFile, uint32_t sampleRate, bool isStereo);
|
|
|
|
~WaveRecorder();
|
|
|
|
|
|
|
|
bool WriteSamples(int16_t* samples, uint32_t sampleCount, uint32_t sampleRate, bool isStereo);
|
2020-12-19 23:30:09 +03:00
|
|
|
};
|