17 #include <QtCore/QByteArray> 18 #include <QtCore/QIODevice> 19 #include <QtMultimedia/QAudioFormat> 34 qint64
readData(
char *data, qint64 maxlen);
37 void start(
int hzFreq);
43 qint64
writeData(
const char *data, qint64 len);
50 int generate(
char *data,
int lengthBytes);
61 const int mSampleRate;
63 const int mSampleSize;
66 const bool mBuffered {
false };
74 static constexpr
int M = 1 << 30;
76 double mOmega { std::nan(
"") };
~AudioSynthDevice()=default
void start(int hzFreq)
Opens device, run generation in buffered mode.
Definition: audioSynthDevice.cpp:31
QIODevice that synthesize sine wave values.
Definition: audioSynthDevice.h:23
qint64 writeData(const char *data, qint64 len)
Stub, because readonly device.
Definition: audioSynthDevice.cpp:112
qint64 bytesAvailable() const
Returns amount of available bytes.
Definition: audioSynthDevice.cpp:120
qint64 readData(char *data, qint64 maxlen)
Provides reading from device.
Definition: audioSynthDevice.cpp:95
AudioSynthDevice(int sampleRate, int sampleSize, QObject *parent=nullptr)
Constructor.
Definition: audioSynthDevice.cpp:21
void stop()
Close device and reset pose.
Definition: audioSynthDevice.cpp:51