QAudioOutput infinite loop
-
Hello @ all,
I'm sorry for the bad english
Here's my problem:I have a class which plays a sound wave with a QBuffer as QIODevice, a QBytearray as wave buffer and a QAudioOutput, but only for limited time.
For my program the soundwave must play 'forever' until I stop it.
But while playing, I must be able to edit the wave.Do you have a solution for this problem?
Thanks for all answers!
Jo
-
Hi and welcome to devnet,
Why not have e.g a QTimer calling a function generating the audio data ? It could also be done in a secondary thread.
Hope it helps
-
Hi,
My solution, reimplement QBuffer::read():
https://github.com/alphaonex86/CatchChallenger/blob/master/client/base/QInfiniteBuffer.cpp
https://github.com/alphaonex86/CatchChallenger/blob/master/client/base/QInfiniteBuffer.h
Work well to do an audio loop.
Cheers,