14 lines
397 B
Factor
14 lines
397 B
Factor
USING: accessors io.files kernel openal sequences ;
|
|
IN: jamshred.sound
|
|
|
|
TUPLE: sounds bang ;
|
|
|
|
: assign-sound ( source wav-path -- )
|
|
resource-path create-buffer-from-wav AL_BUFFER swap set-source-param ;
|
|
|
|
: <sounds> ( -- sounds )
|
|
init-openal 1 gen-sources first sounds boa
|
|
dup bang>> "extra/jamshred/sound/bang.wav" assign-sound ;
|
|
|
|
: bang ( sounds -- ) bang>> source-play check-error ;
|