21 #ifndef AUDIO_PLAYER_H 22 #define AUDIO_PLAYER_H 26 #include <QAudioOutput> 55 int aFrequency = 8000,
57 int aSampleSize = 16 ) ;
66 return iAudioBuffer.size() + QIODevice::bytesAvailable();
80 virtual qint64
writeData (
const char * data, qint64 maxSize ) ;
91 virtual qint64
readData (
char * data, qint64 maxSize ) ;
95 virtual bool open ( OpenMode mode ) ;
109 void error(
int aError,
110 const QString& aExplanation) ;
const int iSampleSize
Definition: audioplayer.h:142
virtual qint64 writeData(const char *data, qint64 maxSize)
virtual qint64 readData(char *data, qint64 maxSize)
void insertAudioFrame(const QByteArray &aFrame)
AudioPlayer(Model &aModel, int aFrequency=8000, int aNumChannels=1, int aSampleSize=16)
virtual bool open(OpenMode mode)
Model & iModel
Definition: audioplayer.h:139
bool iNeedsToRun
Definition: audioplayer.h:138
Class for playback of audio stream, via speaker or other audio dev.
Definition: audioplayer.h:38
QAudioFormat iFormat
Definition: audioplayer.h:135
const int iNumChannels
Definition: audioplayer.h:141
QAudioOutput * iAudioOutput
Definition: audioplayer.h:136
M of the MVC pattern. Handles permanent storage.
Definition: model.h:48
const int iFrequency
Definition: audioplayer.h:140
QByteArray iAudioBuffer
Definition: audioplayer.h:137
void error(int aError, const QString &aExplanation)
virtual bool isSequential() const
Definition: audioplayer.h:102
virtual qint64 bytesAvailable() const
Definition: audioplayer.h:65
void audioMaxLevel(float aMaxVolume)
void finishedPlaying(QAudio::State aState)