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?
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?
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.
Will give it a try!
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.
So that won't work. Any other idea?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.
Last edited by antweb; 24th March 2015 at 07:29.
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
Bookmarks