Add play-waveform and play-sine to openal.examples
parent
ff96ad9475
commit
9f58b3ca62
|
@ -10,6 +10,18 @@ IN: openal.example
|
||||||
source-play
|
source-play
|
||||||
1000 milliseconds sleep ;
|
1000 milliseconds sleep ;
|
||||||
|
|
||||||
|
: play-waveform ( waveshape freq phase duration -- )
|
||||||
|
init-openal
|
||||||
|
[
|
||||||
|
[ 1 gen-sources first dup AL_BUFFER ] 4dip
|
||||||
|
alutCreateBufferWaveform
|
||||||
|
set-source-param
|
||||||
|
source-play
|
||||||
|
] [ seconds sleep ] bi ;
|
||||||
|
|
||||||
|
: play-sine ( freq duration -- )
|
||||||
|
[ ALUT_WAVEFORM_SINE ] 2dip [ 0 ] dip play-waveform ;
|
||||||
|
|
||||||
: (play-file) ( source -- )
|
: (play-file) ( source -- )
|
||||||
100 milliseconds sleep
|
100 milliseconds sleep
|
||||||
dup source-playing? [ (play-file) ] [ drop ] if ;
|
dup source-playing? [ (play-file) ] [ drop ] if ;
|
||||||
|
|
Loading…
Reference in New Issue