QAudioOutput infinite loop
-
wrote on 25 Mar 2015, 17:01 last edited by
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
-
wrote on 26 Mar 2015, 15:57 last edited by
Thanks for your answer.
I'll try it and give you a reply -
wrote on 20 Jun 2019, 01:30 last edited by
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,