class RemiSound::PortDevice

Overview

The PortDevice class is used to playback audio using PortAudio.

PortAudio supports Float32 audio natively, so the #bitDepth field is ignored by this class and is always set to 32.

Defined in:

remisound/drivers/portaudio.cr

Constructors

Instance Method Summary

Instance methods inherited from class RemiSound::AudioDevice

bitDepth : UInt8 bitDepth, bufferSize : UInt32 bufferSize, bufferSize=(value : UInt32) : Nil bufferSize=, channels : UInt8 channels, expectedBufferSize : UInt32 expectedBufferSize, sampleRate : UInt32 sampleRate, start : Nil start, started? : Bool started?, stop : Nil stop, writeBuffer(buf : Array(Float32) | Slice(Float32)) : Nil writeBuffer

Constructor methods inherited from class RemiSound::AudioDevice

new(newSampleRate : Int, newBitDepth : Int, newChannels : Int) new

Constructor Detail

def self.new(newSampleRate : Int, newBitDepth : Int, newChannels : Int) #

[View source]

Instance Method Detail

def start : Nil #
Description copied from class RemiSound::AudioDevice

Opens the audio stream. This must be called before #writeBuffer is called.


[View source]
def stop : Nil #
Description copied from class RemiSound::AudioDevice

Closes the audio stream and frees resources. This must be called when you are finished using the instance.


[View source]
def writeBuffer(buf : Array(Float32) | Slice(Float32)) : Nil #

[View source]