Results 1 to 4 of 4

Thread: Playing 2 wav files continously

  1. #1
    Join Date
    Jul 2010
    Location
    Cairo - Egypt
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Playing 2 wav files continously

    hi
    i need to play 2 files when first is finished start to play the other file.
    and here's the code
    Qt Code:
    1. static PyObject* playwave(PyObject* pSelf, PyObject* pArgs)
    2. {
    3. char* cWaveFile;
    4. int *iSkip;
    5. int *iFuture;
    6. PyArg_ParseTuple(pArgs, "sii", &cWaveFile, &iSkip, &iFuture);
    7. QString ster(cWaveFile);
    8. Phonon::MediaObject *music = NULL;
    9. music->setCurrentSource(Phonon::MediaSource(ster));
    10. music = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(ster));
    11. music->play();
    12. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by HanyM.Magdy; 5th October 2010 at 15:51.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Playing 2 wav files continously

    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-m....html#setQueue
    Òscar Llarch i Galán

  3. #3
    Join Date
    Jul 2010
    Location
    Cairo - Egypt
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Playing 2 wav files continously

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Playing 2 wav files continously

    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.
    Òscar Llarch i Galán

Similar Threads

  1. playing a mp3 file ?
    By hcetiner in forum Newbie
    Replies: 1
    Last Post: 13th May 2010, 10:21
  2. QSound problem playing different wav files
    By couker in forum Qt Programming
    Replies: 6
    Last Post: 16th September 2009, 20:38
  3. Playing Media files in Qt 4
    By sar_van81 in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2007, 05:53
  4. Playing mpegs
    By lewis in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 16:21
  5. Playing movies
    By yellowmat in forum Newbie
    Replies: 5
    Last Post: 29th March 2006, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.