1 ! (c)2010 Joe Groff bsd license
2 USING: accessors alien arrays combinators kernel math openal ;
7 { sample-bits integer }
8 { sample-rate integer }
14 ERROR: format-unsupported-by-openal audio ;
16 : openal-format ( audio -- format )
17 dup [ channels>> ] [ sample-bits>> ] bi 2array {
18 { { 1 8 } [ drop AL_FORMAT_MONO8 ] }
19 { { 1 16 } [ drop AL_FORMAT_MONO16 ] }
20 { { 2 8 } [ drop AL_FORMAT_STEREO8 ] }
21 { { 2 16 } [ drop AL_FORMAT_STEREO16 ] }
22 [ drop throw-format-unsupported-by-openal ]