winmm: PlaySound ignores SND_NOWAIT.

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Thu Jan 13 04:50:50 CST 2011


I tested real w95, w2k and wxp machines.  All behave the same.
 - SND_NOWAIT is ignored.
 - SND_NOSTOP controls whether to abort an already playing sound or
   whether to ignore the new sound and return FALSE.
I could not observe a queue of sounds piling up.  New aborts old or is rejected.

Now Wine behaves like these systems.  This fixes bug 13852.

Test code involves GNU CLISP
(def-call-out playsoundfile
    (:name "PlaySoundA") (:library "winmm.dll") (:language :stdc-stdcall)
    (:return-type boolean)
    (:arguments (sound c-string) (mod c-pointer) (flags uint)))
(defvar *sound* "C:\\Windows\\Media\\chimes.wav")
(defun playN (n &optional (flags #x00002001) (sleep 0.0s0))
   (loop repeat n collect (playsoundfile *sound* nil flags) do (sleep sleep)))

;(playn 5 #x00000001)
;->(T T T T T) -- sound is interrupted (clearer with 0.3s0 sleep)
;(playn 5 #x00000011)
;(playn 5 #x0011 0.3s0)
;->(T NIL NIL T NIL) -- sound plays twice in full
; Adding #x00002000 makes no difference.

 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winmm-PlaySound-ignoress-SND_NOWAIT.patch
Type: application/octet-stream
Size: 1092 bytes
Desc: 0001-winmm-PlaySound-ignoress-SND_NOWAIT.patch
URL: <>

More information about the wine-patches mailing list