1 USING: accessors alien arrays combinators kernel math openal ;
6 { sample-bits integer }
7 { sample-rate integer }
13 ERROR: format-unsupported-by-openal audio ;
15 : openal-format ( audio -- format )
16 dup [ channels>> ] [ sample-bits>> ] bi 2array {
17 { { 1 8 } [ drop AL_FORMAT_MONO8 ] }
18 { { 1 16 } [ drop AL_FORMAT_MONO16 ] }
19 { { 2 8 } [ drop AL_FORMAT_STEREO8 ] }
20 { { 2 16 } [ drop AL_FORMAT_STEREO16 ] }
21 [ drop format-unsupported-by-openal ]