PDA

View Full Version : QSound can not play immediately



thanhluanbk88
21st March 2011, 02:18
Hi,
When i play sound with Sleep function.But it can not play immediately.
I play 2 wav files,but it plays at the same time
Here is my code

sound1 = new QSound("head.wav");
sound2 = new QSound("donkey.wav");


sound1->play();
Sleeper::sleep(15);
sound2->play();


How can i play 2 wav files with Delay between them?
Thanks and best regard!

thanhluanbk88
21st March 2011, 08:30
When i add the MessageBox between.It seems running ok.
Anybody knows how to fix this problem :)

wysota
21st March 2011, 09:16
How can i play 2 wav files with Delay between them?
You play the second sound after the first is finished and not two at once. If your first sound takes 15 seconds to play then run a 15s timer and when it timeouts, play the other sound. Or use some more advanced mechanism than QSound.