Hello,
while I did get Phonon to loop sound from a wav file, I'm observing in the Visual Studio output window that every time the sound is played, 6 threads appear to started and ended (six!). What I'm doing to play back is this:
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mediaObject = new Phonon::MediaObject(this);
Phonon::createPath(mediaObject, audioOutput);
connect(mediaObject, SIGNAL(aboutToFinish()), SLOT(doTheLoop()));
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mediaObject = new Phonon::MediaObject(this);
Phonon::createPath(mediaObject, audioOutput);
connect(mediaObject, SIGNAL(aboutToFinish()), SLOT(doTheLoop()));
To copy to clipboard, switch view to plain text mode
then
mediaObject->stop();
mediaObject->clearQueue();
mediaObject->setCurrentSource(absPath);
mediaObject->play();
mediaObject->stop();
mediaObject->clearQueue();
mediaObject->setCurrentSource(absPath);
mediaObject->play();
To copy to clipboard, switch view to plain text mode
and in the doTheLoop slot:
if (m_loop)
mediaObject->enqueue(*m_loop);
if (m_loop)
mediaObject->enqueue(*m_loop);
To copy to clipboard, switch view to plain text mode
Why would it use so many threads, and how can I change that?
Secondly, is it possible to play multiple sounds at the same time?
Context: Qt 4.8.1, Windows 7 x64/86, Visual Studio 2010
Bookmarks