21 explicit QWaveDecoder(QIODevice *device, QObject *parent =
nullptr);
22 explicit QWaveDecoder(QIODevice *device,
const QAudioFormat &format,
23 QObject *parent =
nullptr);
24 ~QWaveDecoder() override;
26 QAudioFormat audioFormat()
const;
27 QIODevice* getDevice();
29 static qint64 headerLength();
31 bool open(QIODevice::OpenMode mode) override;
32 void close() override;
33 bool seek(qint64 pos) override;
34 qint64 pos()
const override;
35 void setIODevice(QIODevice *device);
36 qint64 size()
const override;
37 bool isSequential()
const override;
38 qint64 bytesAvailable()
const override;
48 qint64 readData(
char *data, qint64 maxlen) override;
49 qint64 writeData(
const char *data, qint64 len) override;
52 bool writeDataLength();
53 bool enoughDataAvailable();
54 bool findChunk(
const char *chunkId);
55 void discardBytes(qint64 numBytes);
60 WaitingForFormatState,
71 bool peekChunk(chunk* pChunk,
bool handleEndianness =
true);
86 quint16 bitsPerSample;
100 static const int HeaderLength =
sizeof(CombinedHeader);
102 bool haveFormat =
false;
103 bool haveHeader =
false;
105 QIODevice *device =
nullptr;
107 State state = InitialState;
108 quint32 junkToSkip = 0;
109 bool bigEndian =
false;
110 bool byteSwap =
false;