From: Arthur E. <ar...@ia...> - 2004-09-13 17:36:43
|
On Sep 13, 2004, at 18:08, Kevin Altis wrote: >>> looked around the archives and documentation, but can't find >>> information on how to use some very limited quicktime functionality. >>> >>> The main functionality I need are the movieplayer to load a sound >>> file, duration and position information. >>> >>> I like to add this an existing pythoncard application, so I suspect >>> a PyObjC solution is out the door? >> >> Well, I'm in the process of developing wxQtMovie for wxPython, which >> should already do what you need. (There's also wxSound, though I >> don't think you can get duration or position information with it.) >> Since pythoncard uses wxPython underneath, I think all that's needed >> is for Kevin A. to make the class accessible from pythoncard itself. >> I'm forwarding this to wxPython developer's list so that we can >> discuss this further and work out a solution. >> > PythonCard already wraps wx.Sound with its own Sound class in > PythonCard/sound.py that is demonstrated by the sound sample > application. There is another sample application, mp3player that uses > the PyGame movie module to play MP3 files and the PyGame movie module > definitely lets you do all the positional manipulation for MPEG. On > the QuickTime front, as soon as Kevin O.'s module is part of the > general wxPython distribution I will make a wrapper component for it, > so maybe wxPython 2.5.2.9? yes, I tried the mp3player example, but diverted to using pygame.mixer as I need more channels and .wav and .aif support. I have this working, but sound.get_length() gives an attribute error.. (mailed the issue to the pygame list). So when Kevin O. will have quicktime working in wx, that would be perfect for my app -> can we test this? Anyway, here's the relevant -commented out- code from the mp3player, but that works fine for me. ## NOTE WE DON'T IMPORT PYGAME UNTIL NOW. Don't put "import pygame" at the top of the file. import pygame self.movie = pygame.movie.Movie(filename) self.movie.play() # it was a good idea at first, but mixer simply doesn't work, at least on the Mac ## assert os.path.exists(filename) ## from pygame import mixer ## mixer.init(44100, 2) ## mixer.music.load(filename) ## mixer.music.play() ## print mixer.music.get_busy() ## #time.sleep(5) ## #mixer.music.stop() Why do you say in the first line pygame shouldn't be imported at an earlier stage in the code? Arthur |