-
Notifications
You must be signed in to change notification settings - Fork 1
/
LEARNING-PLAY-WAV.F
42 lines (29 loc) · 1022 Bytes
/
LEARNING-PLAY-WAV.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
\ Play a sound wav file
\ (c) Valentin First, February 17, 2004, Tuesday, 23:34
\ adapted by PeterForth April2020
REQUIRE LOAD-CONSTANTS ~yz/lib/const.f
S" ~vsp/cons/mmedia.const" LOAD-CONSTANTS
WINAPI: PlaySound WINMM.DLL
CASE-INS OFF
: play-wav ( s -- )
DROP >R (* SND_NODEFAULT SND_FILENAME *) 0 R> PlaySound DROP ;
: play-asynchro-wav ( s -- )
DROP >R W: SND_FILENAME W: SND_ASYNC OR W: SND_NODEFAULT OR 0 R>
PlaySound DROP ;
: play-system-event-sound ( s -- )
DROP >R (* SND_SYNC SND_ASYNC *) 0 R> PlaySound DROP
;
: play-synchro-system-event-sound ( s -- )
DROP >R (* SND_SYNC SND_SYNC *) 0 R> PlaySound DROP ;
: stop-wave W: SND_APPLICATION 0 0 PlaySound DROP ;
: TEST-WAV S" SYSTEMEXIT" play-system-event-sound ;
\EOF more sound examples....
: TT play-system-event-sound ;
S" SystemAsterisk" TT
1000 PAUSE
S" SystemExclamation" TT
1000 PAUSE
S" SystemHand" T
1000 PAUSE
S" SystemStart" T
\ READ MICROSOFT DOC PlaySound function