Handbook
Glossary
streaming-audio-clip
Audio playback engine
Prev:
Audio generator protocol
Next:
<streaming-audio-clip> ( audio-engine source generator buffer-count -- audio-clip/f )
Vocabulary
audio
.
engine
Class description
An
audio-clip
that plays back PCM data streamed by a generator object implementing the
Audio generator protocol
. Use
<streaming-audio-clip>
or
play-streaming-audio-clip
to construct streaming audio clips.
Definition
USING:
kernel
math
specialized-arrays.instances.alien.c-types.uint
;
IN:
audio.engine
TUPLE:
streaming-audio-clip
<
audio-clip
generator
{
channels
integer
initial:
0
}
{
sample-bits
integer
initial:
0
}
{
sample-rate
integer
initial:
0
}
{
al-buffers
uint-array
initial:
uint-array{
}
}
{
done?
boolean
initial:
f
}
;
Methods
USING:
accessors
alien.c-types
alien.data
audio.engine
audio.engine.private
math
openal
;
M::
streaming-audio-clip
(update-audio-clip)
( audio-clip -- )
audio-clip
al-source>>
:>
al-source 0
uint
<ref>
:>
buffer al-source
AL_BUFFERS_PROCESSED
get-source-param
[
al-source 1 buffer
alSourceUnqueueBuffers
audio-clip buffer
uint
deref
queue-clip-buffer
]
times
;
USING:
accessors
audio.engine
destructors
generic
kernel
openal
sequences
;
M:
streaming-audio-clip
dispose*
[
M\
streaming-audio-clip
dispose*
(call-next-method)
]
[
generator>>
dispose
]
[
al-buffers>>
[
length
]
keep
alDeleteBuffers
]
tri
;