Class: AudioStream::AudioInputSynth

Inherits:
Object
  • Object
show all
Includes:
AudioInput
Defined in:
lib/audio_stream/audio_input_synth.rb

Instance Method Summary collapse

Constructor Details

#initialize(synth, soundinfo:) ⇒ AudioInputSynth

Returns a new instance of AudioInputSynth.



5
6
7
8
9
10
# File 'lib/audio_stream/audio_input_synth.rb', line 5

def initialize(synth, soundinfo:)
  super()

  @synth = synth
  @soundinfo = soundinfo
end

Instance Method Details

#connectObject



12
13
14
# File 'lib/audio_stream/audio_input_synth.rb', line 12

def connect
  self
end

#connected?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/audio_stream/audio_input_synth.rb', line 20

def connected?
  true
end

#disconnectObject



16
17
18
# File 'lib/audio_stream/audio_input_synth.rb', line 16

def disconnect
  self
end

#each(&block) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/audio_stream/audio_input_synth.rb', line 24

def each(&block)
  Enumerator.new do |y|
    loop {
      buf = @synth.next
      y << buf
    }
  end.each(&block)
end