( sound DAY 05.04.2001 )

API: SndPlaySystemSound
API: SndDoCmd

: sysbeep ( beepId -- )
  SndPlaySystemSound
;

: beep 2 sysbeep ;

variable swait
swait on

create sndcmd 0 , 0 , 0 ,

: sound ( vol dur hz -- )
\ vol-0..64
    swait @ if 1 else 3 then
    sndcmd c!
    sndcmd cell+ w!
    sndcmd cell+ 2+ w!
    sndcmd cell+ cell+ w!
    sndcmd >abs
    0 swap 0 SndDoCmd drop
;