Class: Sbire::AudioConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/sbire/audio_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid_manager) ⇒ AudioConverter

Returns a new instance of AudioConverter.



4
5
6
# File 'lib/sbire/audio_converter.rb', line 4

def initialize(pid_manager)
  @pid_manager = pid_manager
end

Instance Attribute Details

#pid_managerObject

Returns the value of attribute pid_manager.



3
4
5
# File 'lib/sbire/audio_converter.rb', line 3

def pid_manager
  @pid_manager
end

Instance Method Details

#start(&block) ⇒ Object



8
9
10
11
12
# File 'lib/sbire/audio_converter.rb', line 8

def start(&block)
  FileUtils.rm_rf("#{SbireConfig.out_path}/.")
  pid = listen_audio(block)
  pid_manager.store(self, pid)
end

#stopObject



14
15
16
# File 'lib/sbire/audio_converter.rb', line 14

def stop
  pid_manager.kill(self)
end