Handbook
Glossary
read-audio ( path -- audio )
Audio file loader
Next:
register-audio-extension ( extension quot -- )
Vocabulary
audio
.
loader
Inputs
path
a pathname string
Outputs
audio
an
audio
Word description
Reads the audio data from the file on disk named
path
, saving the data in an
audio
object. If the file's extension is not recognized, an
unknown-audio-extension
error is thrown.
Definition
USING:
ascii
assocs
combinators
io.pathnames
kernel
namespaces
;
IN:
audio.loader
:
read-audio
( path -- audio )
dup
file-extension
>lower
audio-types
get
?at
[
( path -- audio )
call-effect
]
[
unknown-audio-extension
]
if
;