diff --git a/audiohandler.cpp b/audiohandler.cpp index dcf463d..5441db3 100644 --- a/audiohandler.cpp +++ b/audiohandler.cpp @@ -14,6 +14,7 @@ audioHandler::audioHandler(QObject* parent) : isInput(0), chunkAvailable(false) { + Q_UNUSED(parent) } audioHandler::~audioHandler() @@ -248,6 +249,7 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int { Q_UNUSED(outputBuffer); Q_UNUSED(streamTime); + Q_UNUSED(status); int sentlen = 0; int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample const char* data = (const char*)inputBuffer; @@ -278,27 +280,6 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int return 0; } -qint64 audioHandler::bytesAvailable() const -{ - return 0; -} - -bool audioHandler::isSequential() const -{ - return true; -} - -void audioHandler::notified() -{ -} - - -void audioHandler::stateChanged(QAudio::State state) -{ - -} - - void audioHandler::incomingAudio(audioPacket inPacket) { @@ -354,7 +335,7 @@ void audioHandler::incomingAudio(audioPacket inPacket) for (int f = 0; f < inPacket.data.length() / 2; f++) { *in = *in * this->volume; - *in++; + in++; } } @@ -405,11 +386,6 @@ int audioHandler::getLatency() return currentLatency; } -bool audioHandler::isChunkAvailable() -{ - return (chunkAvailable); -} - void audioHandler::getNextAudioChunk(QByteArray& ret) { audioPacket packet; @@ -452,7 +428,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret) for (int f = 0; f < outPacket.length()/2; f++) { *out++ = *in++; - *in++; // Skip each even channel. + in++; // Skip each even channel. } packet.data.clear(); packet.data = outPacket; // Copy output packet back to input buffer. diff --git a/audiohandler.h b/audiohandler.h index eddc625..d978644 100644 --- a/audiohandler.h +++ b/audiohandler.h @@ -50,22 +50,11 @@ public: int getLatency(); - bool setDevice(QAudioDeviceInfo deviceInfo); - - void start(); - void flush(); - void stop(); - - qint64 bytesAvailable() const; - bool isSequential() const; void getNextAudioChunk(QByteArray &data); - bool isChunkAvailable(); private slots: bool init(const quint8 bits, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isulaw, const bool isinput, int port, quint8 resampleQuality); void changeLatency(const quint16 newSize); - void notified(); - void stateChanged(QAudio::State state); void setVolume(unsigned char volume); void incomingAudio(const audioPacket data);