2017-08-25 18:34:26 -04:00
|
|
|
! Copyright (C) 2009 Joe Groff.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2010-01-19 15:46:06 -05:00
|
|
|
USING: ascii assocs io.pathnames kernel namespaces
|
2011-11-02 14:23:41 -04:00
|
|
|
vocabs ;
|
2010-01-19 15:46:06 -05:00
|
|
|
IN: audio.loader
|
|
|
|
|
|
|
|
ERROR: unknown-audio-extension extension ;
|
|
|
|
|
|
|
|
SYMBOL: audio-types
|
|
|
|
audio-types [ H{ } clone ] initialize
|
|
|
|
|
|
|
|
: register-audio-extension ( extension quot -- )
|
|
|
|
swap audio-types get set-at ;
|
|
|
|
|
|
|
|
: read-audio ( path -- audio )
|
|
|
|
dup file-extension >lower audio-types get ?at
|
|
|
|
[ call( path -- audio ) ]
|
2015-08-13 19:13:05 -04:00
|
|
|
[ unknown-audio-extension ] if ;
|
2010-01-19 15:46:06 -05:00
|
|
|
|
|
|
|
"audio.wav" require
|
|
|
|
"audio.aiff" require
|