: play-sine ( freq duration -- )
[ ALUT_WAVEFORM_SINE ] 2dip [ 0 ] dip play-waveform ;
-
+
: (play-file) ( source -- )
100 milliseconds sleep
dup source-playing? [ (play-file) ] [ drop ] if ;
: play-file ( filename -- )
init-openal
- create-buffer-from-file
+ create-buffer-from-file
1 gen-sources
first dup [ AL_BUFFER rot set-source-param ] dip
dup source-play
: play-wav ( filename -- )
init-openal
- create-buffer-from-wav
+ create-buffer-from-wav
1 gen-sources
first dup [ AL_BUFFER rot set-source-param ] dip
dup source-play