PDA

View Full Version : Playing 2 wav files continously



HanyM.Magdy
5th October 2010, 15:43
hi
i need to play 2 files when first is finished start to play the other file.
and here's the code

static PyObject* playwave(PyObject* pSelf, PyObject* pArgs)
{
char* cWaveFile;
int *iSkip;
int *iFuture;
PyArg_ParseTuple(pArgs, "sii", &cWaveFile, &iSkip, &iFuture);
QString ster(cWaveFile);
Phonon::MediaObject *music = NULL;
music->setCurrentSource(Phonon::MediaSource(ster));
music = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(ster));
music->play();
}

^NyAw^
5th October 2010, 15:53
Hi,

As I can read on Qt 4.7.0 docs, you can queue many sources you need:

http://doc.qt.nokia.com/4.7/phonon-mediaobject.html#setQueue
(http://doc.trolltech.com/latest/http://doc.qt.nokia.com/4.7/phonon-mediaobject.html#setqueue.html)

HanyM.Magdy
5th October 2010, 15:59
thanks ^NyAw^ for replay
but what i need that this function is called from python script so if he call this function 2 times without a break
the two files playing together so i need to don't playing the second file until the first is playing

^NyAw^
5th October 2010, 16:11
Hi,

Read the "Detailed Description" chapter on class documentation. It explains how to queue sources as I explained. You can add N sources and them will play secuentially. It's easier to play them secuentially than in parallel.