Win32Lib: PlaySound parameters
- Posted by Dan Moyer <DanMoyer at PRODIGY.NET> Nov 02, 1999
- 533 views
David, Can you give me some more information about PlaySound & its parameters? I'm using it to give voice to some math flash cards & my problem is that in SYNCHRONOUS mode (1,0) some related list boxes which are variously supposed to be made invisible & visible BEFORE the sounds begin to play, instead disappear & don't reappear until it is FINISHED playing (which looks bad), while in ASYNCHRONOUS mode (0,1) it only plays the LAST wave file requested (although it treats the list boxes ok). I like how ASYNC lets various user actions interrupt PlaySound, but I can't use it if I can't get it to play a sequence of waves one after another rather than just the last requested as it's doing. There appears to be a flag which can be set in the PlaySound function called "SND_NOSTOP" which if set returns false if PlaySound is busy already playing something, which would seem to let me put each successive wave to be played into a test loop to see if the previous one is finished or not; but I don't know how to set that flag in PlaySound. (I'm not sure that approach would still preserve the "interruptibility" I like about ASYNC mode, but I can't try it if I can't set the flag; I tried something similar with ASYNC by putting time delays between successive sounds, but while that worked to make a succession of wave files play, it made the list box controls disappear just like SYNC mode. If there were some way to send PlaySound async a "play list", that would seem to be optimal, but I suspect that's not an option.) Dan Moyer