Class: FFI::PortAudio::Stream

Inherits:
Object
  • Object
show all
Includes:
FFI::PortAudio
Defined in:
lib/ffi-portaudio/stream.rb

Constant Summary

Constants included from FFI::PortAudio

VERSION

Instance Method Summary collapse

Instance Method Details

#closeObject



16
17
18
# File 'lib/ffi-portaudio/stream.rb', line 16

def close
  API.Pa_CloseStream(@stream.read_pointer)
end

#open(input, output, freq, frames = API::FramesPerBufferUnspecified, flags = API::NoFlag, userdata = nil) ⇒ Object



4
5
6
7
8
# File 'lib/ffi-portaudio/stream.rb', line 4

def open(input, output, freq, frames=API::FramesPerBufferUnspecified, flags=API::NoFlag, userdata=nil)
  @input, @output, @freq, @frames, @flags, @userdata = input, output, freq, frames, flags, userdata
  @stream = FFI::Buffer.new :pointer
  API.Pa_OpenStream(@stream, @input, @output, @freq, @frames, @flags, @method = method(:process), @userdata)
end

#process(input, output, frameCount, timeInfo, statusFlags, userData) ⇒ Object



10
# File 'lib/ffi-portaudio/stream.rb', line 10

def process(input, output, frameCount, timeInfo, statusFlags, userData);end

#startObject



12
13
14
# File 'lib/ffi-portaudio/stream.rb', line 12

def start
  API.Pa_StartStream @stream.read_pointer
end