c++ - Qt: How to repeat sound x times with QtSound -


i'm not sure understand correctly how qsound.setloop function should work.

i want play wave file 3 times. tried following code plays once.

qsound soundobj(filepath); soundobj.setloops(3); soundobj.play(); 

help :-)

edit: full version of code looks this

void alarms::playsound(qstring filepath) {     qsound soundobj(filepath);     soundobj.setloops(3);     soundobj.play(); } 

soundobj object destroyed quickly.
has allocated dynamically.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -