Question

I am writing a program for audio-visual experiments, which will present a pre-generated list of audio-only and video-with-audio stimuli to experiment subjects. I have decided to use PyQT and Phonon for this, despite the fact that I'm fairly new to writing QT-based programs (and GUI programming in general).

The issue I'm having is that, when the previous file played was video (.mov in this case), and the current file is audio-only (.wav file), the image from the last frame of the video file remains on the screen while the audio file is playing. The video image remains until the next .mov file rolls around in the stimulus list.

Is there a way to clear the Phonon screen, in order to show just an empty black screen while the audio-only files are playing? I've done a fair bit of poking around with Google, and though this question has been asked by a number of people on different forums, it seems to have gone unanswered.

Any suggestions will be greatly appreciated!

Was it helpful?

Solution

This seems to be a bug, or missing feature, and it's hard to come up with a good workaround.

One somewhat hacky solution is to force a resize of the video widget:

    size = self.video.size()
    self.video.resize(0, 0)
    self.video.resize(size)

but I wouldn't bet on this working on all platforms.

A more reliable workaround would be to put the video-widget inside a container widget with a black background, and then simply hide/show the video-widget when stopping/starting the media.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top