1 ! Copyright (C) 2009 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: ascii assocs io.pathnames kernel namespaces
7 ERROR: unknown-audio-extension extension ;
10 audio-types [ H{ } clone ] initialize
12 : register-audio-extension ( extension quot -- )
13 swap audio-types get set-at ;
15 : read-audio ( path -- audio )
16 dup file-extension >lower audio-types get ?at
17 [ call( path -- audio ) ]
18 [ unknown-audio-extension ] if ;