1 ! Copyright (C) 2007 Chris Double.
\r
2 ! See http://factorcode.org/license.txt for BSD license.
\r
5 USING: openal kernel alien threads sequences calendar ;
\r
10 first dup AL_BUFFER alutCreateBufferHelloWorld set-source-param
\r
12 1000 milliseconds sleep ;
\r
14 : (play-file) ( source -- )
\r
15 100 milliseconds sleep
\r
16 dup source-playing? [ (play-file) ] [ drop ] if ;
\r
18 : play-file ( filename -- )
\r
20 create-buffer-from-file
\r
22 first dup >r AL_BUFFER rot set-source-param r>
\r
27 : play-wav ( filename -- )
\r
29 create-buffer-from-wav
\r
31 first dup >r AL_BUFFER rot set-source-param r>
\r