Reputation: 149
I am trying to develop a multimedia program using Qt which gets an audio input stream from a microphone (using QAudioInput
), then stores the sampled bytes in memory for 60 milliseconds, then play it back (using QAudioOutput
).
The documentation for QAudioOuput
has an example which does most of this, but it uses a file as its data source instead. How can I modify this to use an input stream instead?
Upvotes: 4
Views: 4339
Reputation: 6339
QAudioInput::start() and QAudioOutput::start() both take a pointer to a QIODevice as a parameter. This could be pointer to a QFile (like in the example) or a QBuffer if you want to keep the data in the memory.
Upvotes: 5