I just realized that this might also be interesting for PyGame users that haven't done any wxPython yet. Suggestions and improvements welcome, I still have no idea why the display gets its own window. If you want to send improvements directly to me I can summarize for both lists. Enjoy, ka --- Kevin Altis altis@semi-retired.com http://radio.weblogs.com/0102677/ http://www.pythoncard.org/ -----Original Message----- From: Kevin Altis [mailto:altis@semi-retired.com] Sent: Monday, February 17, 2003 12:33 PM To: Wxpython-Users Subject: [wxPython-users] sample MP3 and MPEG player using PyGame 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/ 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
Attachment:
mplay-2003-02-17.zip
Description: Zip compressed data
--------------------------------------------------------------------- To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org