Handbook
Glossary
read-wav-chunks ( -- fmt data )
Vocabulary
audio
.
wav
Inputs
None
Outputs
fmt
an
object
data
an
object
Definition
USING:
audio.chunked-file
classes.struct
combinators
combinators.short-circuit
kernel
;
IN:
audio.wav
::
read-wav-chunks
( -- fmt data )
f
:>
fmt!
f
:>
data!
[
{
[
fmt data
and
not
]
[
read-chunk
]
}
0&&
]
[
{
{
[
dup
FMT-MAGIC
wav-fmt-chunk
check-chunk
]
[
wav-fmt-chunk
memory>struct
fmt!
]
}
{
[
dup
DATA-MAGIC
wav-data-chunk
check-chunk
]
[
wav-data-chunk
memory>struct
data!
]
}
[
drop
]
}
cond
]
while*
fmt data
2dup
and
[
invalid-audio-file
]
unless
;