PDA

View Full Version : Reemit readyRead() signal from audio device



Thomas1313
11th August 2011, 15:51
I need to process audio data in realtime (without writing to drive as in examples). For this purpose I use QAudioInput from QtMultimedia (Qt 4.7.3, Mac OS X 10.5.8) which works in a "push" mode:


QAudioInput* m_pStream = new QAudioInput(Format, this);
QIODevice* m_pBuffer = m_pStream->start();
connect(m_pBuffer, SIGNAL(readyRead()), this, SLOT(SendData()));

Slot SendData reads buffer and sends data to the processing algorithm:


void CQtAudioStream::SendData()
{
Q_ASSERT(m_pBuffer);

emit SendAudioBuffer(m_pBuffer->readAll().data());
}

The problem is readyRead() signal emits only once from m_pBuffer device. What should I do to reemit it?