PDA

View Full Version : Play a section of an audio file (phonon)



michael_h
20th August 2015, 19:37
Hi All,
Is there a way to tell a Phonon::MediaObject to play part of an audio file? I can use 'seek' to tell it to start at a certain time, but I'd also like to be able to tell it to stop at a certain time. I tried setting the tick interval and connecting MediaObject::tick to MediaObject::pause, but the delay is too long on that (about 0.15 seconds).

I'm using PyQt 4.6.2 (Qt 4.6.2), which I realize is a bit old, but it's all that's available to me.

smcg
25th August 2015, 18:32
Don't have a solution but FWIW...

I have a program that does exactly as you describe: set the tickinterval to 10mS and stop the playing when a predetermined end time is reached. The play lengths are at most a few seconds, sometimes less than 1S. This worked fine in Fedora-15 / PyQt-4.8.6 / Qt-4.7.4. But after upgrading my system to Fedora 21 / PyQt-4.11.3 / Qt 4.8.6 I now see the same effect that you do: the tick handler function seems to be called, by eye-balling output of a print statement in it, every 150mS or so despite the tickinterval setting.

I hope someone can suggest a solution for this.