Files
oak-editor/app/decoder/waveoutput.h
T
itsmattkc 9a44e656b5 added simple wave classes
To assist the input/output of PCM data, we use the fairly straight-forward
WAVE format. These classes simplify the input and output of such data.
2019-11-15 13:49:40 +09:00

42 lines
643 B
C++

#ifndef WAVEAUDIO_H
#define WAVEAUDIO_H
#include <QByteArray>
#include <QFile>
#include "audio/sampleformat.h"
#include "render/audioparams.h"
class WaveOutput
{
public:
WaveOutput(const QString& f,
const AudioRenderingParams& params);
~WaveOutput();
Q_DISABLE_COPY_MOVE(WaveOutput)
bool open();
void write(const QByteArray& bytes);
void write(const char* bytes, int length);
void close();
private:
template<typename T>
void write_int(QFile* file, T integer);
void switch_endianness(QByteArray &array);
QFile file_;
AudioRenderingParams params_;
int data_length_;
};
#endif // WAVEAUDIO_H