[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Pygame Release 1.5.2



Bob Ippolito wrote:
> I tried using pygame.movie to play an mpeg video clip, and it bonked out 
> with a DirectSound exception when I tried to run it on win32 without a 
> soundcard installed.  Any chance of a quick fix, or would it also 
> require a patch to SDL?

hmm, pygame.movie discovers if SDL audio is available if nothing else has 
initialized it. it then passes this along to

     SMPEG_enableaudio(movie, onoff);

making this a tricky thing to fix. the problem _should_ be fixed on the 
SMPEG side, but i have a feeling that's not going to happen any time soon. 
perhaps try setting SDL to use the 'windib' drivers. then it won't do 
anything with directx, and perhaps fail silently?

set SDL_AUDIODRIVER = windib

you may or may not also have to set the SDL_VIDEODRIVER to the same thing 
for this to work, i am unsure. there is also a special "disk" audio driver 
which saves all audio out to disk. on unix it is simple to set the file to 
something like /dev/null, but on windows there is nothing like that?

SDL_AUDIODRIVER = disk
SDL_DISKENVR_OUTIFLE = /dev/null


if this still ends up not working well, i could add a "sound" boolean 
argument to the Movie() function. the tricky part will be when do you 
actually use it? i guess you could add a block of code like this

     try:
         pygame.mixer.init()
         pygame.mixer.quit()
         audioworks = 1
     except pygame.error:
         audioworks = 0

hmm, or maybe i could pack some code like that into pygame.movie 
automatically the first time it tries to initialize audio.. that might be 
best and most foolproof. hmm..




____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org