class RemiAudio::Drivers::PortAudio::PaStream
- RemiAudio::Drivers::PortAudio::PaStream
- Reference
- Object
Defined in:
remiaudio/drivers/port-bindings.crConstructors
- .openDefaultStream(numInput : Int | Nil, numOutput : Int | Nil, sampleFormat : SampleFormat, sampleRate : SampleRate, framesPerBuffer : Int, callback : PaCallback, userData : Pointer(Void) | Nil = nil) : PaStream
- .openDefaultStream(numInput : Int | Nil, numOutput : Int | Nil, sampleFormat : SampleFormat, sampleRate : SampleRate, framesPerBuffer : Int) : PaStream
- .openDefaultStream(numInput : Int | Nil, numOutput : Int | Nil, sampleFormat : SampleFormat, sampleRate : SampleRate, framesPerBuffer : Int, userData : Pointer(Void) | Nil, &block : PaCallback) : PaStream
- .openStream(inputParams : StreamParameters | Nil, outputParams : StreamParameters | Nil, sampleRate : SampleRate, framesPerBuffer : Int, streamFlags : StreamFlags) : PaStream
Class Method Summary
-
.mergeArrays(channelCount : Int, *data : Slice(Float32)) : Slice(Float32)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Slice(Int32)) : Slice(Int32)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Slice(Int16)) : Slice(Int16)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Slice(Int8)) : Slice(Int8)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Slice(UInt8)) : Slice(UInt8)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Array(Float32)) : Array(Float32)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Array(Int32)) : Array(Int32)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Array(Int16)) : Array(Int16)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Array(Int8)) : Array(Int8)
A utility function that merges individual channels into interleaved data.
-
.mergeArrays(channelCount : Int, *data : Array(UInt8)) : Array(UInt8)
A utility function that merges individual channels into interleaved data.
-
.separateArray(channelCount : Int, data : Slice(Float32)) : Array(Float32)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Slice(Int32)) : Array(Int32)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Slice(Int16)) : Array(Int16)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Slice(Int8)) : Array(Int8)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Slice(UInt8)) : Array(UInt8)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Array(Float32)) : Array(Float32)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Array(Int32)) : Array(Int32)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Array(Int16)) : Array(Int16)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Array(Int8)) : Array(Int8)
A utility function that separates interleaved data into individual channels.
-
.separateArray(channelCount : Int, data : Array(UInt8)) : Array(UInt8)
A utility function that separates interleaved data into individual channels.
-
.withDefaultStream(numInput : Int | Nil, numOutput : Int | Nil, *, sampleFormat : SampleFormat = SampleFormat::Float32, sampleRate : SampleRate = 44100, framesPerBuffer : Int = 1024, &) : Nil
Opens the default audio stream using the given options and starts it with
#start
. -
.withStream(inputParams : StreamParameters | Nil, outputParams : StreamParameters | Nil, *, sampleRate : SampleRate = 44100, framesPerBuffer : Int = 1024, streamFlags : StreamFlags = StreamFlags::NoFlag, &) : Nil
Opens an audio stream using the given options and starts it with
#start
.
Instance Method Summary
-
#<<(data : Slice(Float32)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Array(Float32)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Slice(Int32)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Array(Int32)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Slice(Int16)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Array(Int16)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Slice(Int8)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Array(Int8)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Slice(UInt8)) : PaStream
Writes sample data to an output stream.
-
#<<(data : Array(UInt8)) : PaStream
Writes sample data to an output stream.
-
#abort : Nil
Terminates audio processing immediately without waiting for pending buffers to complete.
- #active? : Bool
- #close : Nil
- #framesPerBuffer : UInt64
- #info : StreamInfo
- #inputChannels : Int32 | Nil
- #inputSampleFormat : SampleFormat | Nil
- #outputChannels : Int32 | Nil
- #outputSampleFormat : SampleFormat | Nil
-
#read(dest : Slice(Float32)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Slice(Float32).class) : Slice(Float32)
Attempts to read samples from an input stream.
-
#read(dest : Array(Float32)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Array(Float32).class) : Array(Float32)
Attempts to read samples from an input stream.
-
#read(dest : Slice(Int32)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Slice(Int32).class) : Slice(Int32)
Attempts to read samples from an input stream.
-
#read(dest : Array(Int32)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Array(Int32).class) : Array(Int32)
Attempts to read samples from an input stream.
-
#read(dest : Slice(Int16)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Slice(Int16).class) : Slice(Int16)
Attempts to read samples from an input stream.
-
#read(dest : Array(Int16)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Array(Int16).class) : Array(Int16)
Attempts to read samples from an input stream.
-
#read(dest : Slice(Int8)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Slice(Int8).class) : Slice(Int8)
Attempts to read samples from an input stream.
-
#read(dest : Array(Int8)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Array(Int8).class) : Array(Int8)
Attempts to read samples from an input stream.
-
#read(dest : Slice(UInt8)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Slice(UInt8).class) : Slice(UInt8)
Attempts to read samples from an input stream.
-
#read(dest : Array(UInt8)) : Bool
Attempts to read samples from an input stream into the destination.
-
#read(destType : Array(UInt8).class) : Array(UInt8)
Attempts to read samples from an input stream.
- #readAvailable : Int64
-
#start : Nil
Commences audio processing
-
#stop : Nil
Terminates audio processing.
- #stopped? : Bool
- #time : Float64
- #writeAvailable : Int64
Constructor Detail
Class Method Detail
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that merges individual channels into interleaved data.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
A utility function that separates interleaved data into individual channels.
Opens the default audio stream using the given options and starts it with
#start
. This then yields the stream. This ensures that the stream is
both stopped with #stop
and closed with #close
before returning.
Opens an audio stream using the given options and starts it with #start
.
This then yields the stream. This ensures that the stream is both stopped
with #stop
and closed with #close
before returning.
Instance Method Detail
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Writes sample data to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data. The size of the data must be equal to the frames per buffer multiplied by the number of output channels.
This returns self
.
Terminates audio processing immediately without waiting for pending buffers to complete.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Attempts to read samples from an input stream into the destination. The method doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
The size of the destination must be less than or equal to the number of frames per buffer multiplied by the channel count.
On success, this returns true
. If input data was discarded by PortAudio
after the previous call and before this call, this returns false
.
Otherwise this will raise a PaError
if another error occurs.
Attempts to read samples from an input stream. The method doesn't return until one entire buffer has been filled - this may involve waiting for the operating system to supply the data. The size of returned data equal to the number of frames per buffer multiplied by the channel count.
On success, this returns the batch of data. Otherwise this will raise a
PaError
if another error occurs.
Terminates audio processing. It will wait until all pending audio buffers have been played before returning.