class
Raudio::AudioStream
- Raudio::AudioStream
- Reference
- Object
Overview
AudioStream represents a custom audio stream Use this for procedural audio or custom audio processing
Defined in:
raudio/audio_stream.crConstant Summary
-
NOOP_CALLBACK =
->(buffer : Pointer(Void), frames : UInt32) do end
-
NOOP callback retained to avoid GC (used when clearing callbacks)
Constructors
-
.load(sample_rate : UInt32, sample_size : UInt32, channels : UInt32) : self
Load audio stream (to stream raw audio pcm data)
Class Method Summary
-
.attach_mixed_processor(processor : LibRaudio::AudioCallback)
Attach audio stream processor to the entire audio pipeline
-
.attach_mixed_processor(&block : Pointer(Void), UInt32 -> )
Attach audio stream processor to the entire audio pipeline (block form)
-
.buffer_size_default=(size : Int32)
Default size for new audio streams
-
.detach_mixed_processor(processor : LibRaudio::AudioCallback)
Detach audio stream processor from the entire audio pipeline
-
.ready?(handle : LibRaudio::AudioStream) : Bool
Check if audio stream is ready
Instance Method Summary
-
#attach_processor(processor : LibRaudio::AudioCallback)
Attach audio stream processor to stream
-
#attach_processor(&block : Pointer(Void), UInt32 -> )
Attach audio stream processor to stream (block form)
-
#callback=(cb : LibRaudio::AudioCallback)
Set per-stream callback (single).
-
#channels : UInt32
Get number of channels
- #clear_callback
- #close
-
#detach_processor(processor : LibRaudio::AudioCallback)
Detach audio stream processor from stream
- #finalize
-
#pan=(pan : Float32)
Set pan for audio stream (0.5 is center)
-
#pause
Pause audio stream
-
#pitch=(pitch : Float32)
Set pitch for audio stream (1.0 is base level)
-
#play
Play audio stream
-
#playing? : Bool
Check if audio stream is playing
-
#processed? : Bool
Check if any audio stream buffers requires refill
-
#ready? : Bool
Check if this audio stream is ready
- #release
- #released? : Bool
-
#resume
Resume audio stream
-
#sample_rate : UInt32
Get sample rate
-
#sample_size : UInt32
Get sample size
-
#set_callback(&block : Pointer(Void), UInt32 -> )
Set per-stream callback (block form).
-
#stop
Stop audio stream
-
#to_unsafe : Raudio::LibRaudio::AudioStream
Get the underlying C struct
-
#update(data : Pointer(Void), frame_count : Int32)
Update audio stream buffers with data
-
#volume=(volume : Float32)
Set volume for audio stream (1.0 is max level)
Constructor Detail
Load audio stream (to stream raw audio pcm data)
Class Method Detail
Attach audio stream processor to the entire audio pipeline
Attach audio stream processor to the entire audio pipeline (block form)
Detach audio stream processor from the entire audio pipeline
Instance Method Detail
Attach audio stream processor to stream
Attach audio stream processor to stream (block form)
Set per-stream callback (single). Overwrites previous.
Detach audio stream processor from stream
Set per-stream callback (block form). Overwrites previous.