async. winsound .PlaySound question....

Michael Robin me at mikerobin.com
Sun Oct 21 18:00:26 EDT 2001


This looks like a wrapper around Windows' MMSYSTEM dll. 
This Windows sub-system does not support playing more 
than one sound at the same time. ASYNC in this case
means "return from the call right away" rather than
"wait for the sound to complete". ASYNC and NOSTOP
don't work together when a sound is already
playing - there is also no automatic queuing in this
interface. 

If you want to be win32 specific, use DirectX and the
win32com extensions. 
An easier route is probably to use pygame's wrapper of
SDL which does support mixing and looping of sounds 
(but no queuing/concatenation.) (www.pygame.org) 
This will also work on *nix platforms. 

If you do a google search on "Crossplattform audio"
you will also see a recent thread. 

hope this helps,
mike


andrew at mail.idrive.com (andrew) wrote in message news:<70461e98.0110191729.62212d6b at posting.google.com>...
> i cannot seem to get my system to run more than one winsound.PlaySound
> asyncronously ... I think I am using the right flags ... here is my
> code snippet:
> 
> 
> winsound.PlaySound(filePath1, winsound.SND_FILENAME |
> winsound.SND_ASYNC | winsound.SND_NOSTOP)
> 
> winsound.PlaySound(filePath2,  winsound.SND_FILENAME |
> winsound.SND_ASYNC | winsound.SND_NOSTOP)
> 
> 
> on the second attempt to play a sound, i get a RunTimeError.  i am on
> a win2k system with a full-duplex enabled sound driver.  Python 2.1.
> 
> any ideas?
> 
> thanks in advance



More information about the Python-list mailing list