Results 1 to 5 of 5

Thread: Phonon : Add delay in between queue

  1. #1
    Join Date
    Jul 2014
    Posts
    46
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Phonon : Add delay in between queue

    I am using a mediaobject and enqueue to play 5 mp3 files. Is it possible that the first two files are played back to back and then I have a delay of 2 seconds and then the rest three are played?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,319
    Thanks
    316
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Phonon : Add delay in between queue

    If the media object has a "finished" signal to indicate when each file has ended, and "pause" and "resume" slots to control playing, then you can connect the finished signal to a slot that starts a 3-second one-shot timer and pauses playing, and connect the timer's timeout signal to a slot that resumes the play. You simply need to count how many time the finished signal handler is called to decide when to start the timer.

  3. #3
    Join Date
    Jul 2014
    Posts
    46
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Phonon : Add delay in between queue

    Will give it a try!

  4. #4
    Join Date
    Jul 2014
    Posts
    46
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Phonon : Add delay in between queue

    void MediaObject::finished () [signal]
    Emitted when the object has finished playback. It is not emitted if you call stop(), pause() or load(). It is emitted only when the current media source has finished playing and the media queue() is empty, or when a fatal error occurs.

    Warning: This signal is not emitted when the current source has finished and there's another source in the queue. It is only emitted when the queue is empty.
    So that won't work. Any other idea?
    Last edited by antweb; 24th March 2015 at 07:29.

  5. #5
    Join Date
    Oct 2014
    Posts
    81
    Thanks
    20
    Thanked 9 Times in 9 Posts
    Qt products
    Qt5
    Platforms
    Windows
    Wiki edits
    7

    Default Re: Phonon : Add delay in between queue

    Isn't it possible to create a MediaSource object that represents silence? Then you can add it to the queue.
    For example, create a MediaSource object from a QIODevice pointing to empty WAV data (you create a buffer formatted like a WAV file with two seconds worth of silence data).

    http://doc.qt.io/qt-4.8/phonon-media...#MediaSource-6

Similar Threads

  1. Replies: 0
    Last Post: 23rd February 2012, 19:31
  2. Replies: 0
    Last Post: 19th September 2011, 10:11
  3. phonon playback delay
    By mortoray in forum Qt Programming
    Replies: 1
    Last Post: 8th December 2010, 13:36
  4. Phonon playback delay
    By jflatt in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2010, 05:58
  5. phonon queue problem
    By Lykurg in forum Qt Programming
    Replies: 1
    Last Post: 25th December 2008, 14:20

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
  •  
Qt is a trademark of The Qt Company.