I don't really have time to adequately pursue this sample right now and
since other people are interested in better multimedia capabilities for
wxPython I thought I would simply put this out and let someone else run with
it.
This is a very simplistic example using PyGame as the mechanism to play MP3s
and MPEG movies. It doesn't handle all the variants of the formats, which
might be a codec issue. So far I have only tested it on Windows 2000.
Hopefully, it works on the Mac and Linux too since PyGame is available for
those platforms; anyone want to confirm that?
If you want to dig deeper into what will and won't work and getting the MPEG
to actually play on the panel instead of showing up in its own window, you
will need to get on the PyGame mailing list and probably get some help from
Pete Shinners or one of the other experts.
http://www.pygame.org/info.shtml#maillist
To use the app, simply select an MP3 or MPEG file you want to play, then
click on the Play button, that's it. Stop will of course Stop the playback.
I've found that if you close the PyGame window that appears for MPEG movies
that Python tends to crash, so close the main App window instead when you
want to quit.
I used the pygame.movie module instead of the pygame.mixer module for
playback because even with MP3s, the movie module seemed more robust. Using
mixer for MP3s is worthy of more investigation.
I already included the code to get a PyCrust shell window as part of the
app, just change the if 0: to if 1: to turn it on. Then once you start
playing a movie, you can control it in the shell like this:
pcapp.frame.movie.get_busy()
1
pcapp.frame.movie.pause()
...
ka
mplay-2003-02-17.zip (7.33 KB)