Class: Sbire::AudioConverter
- Inherits:
-
Object
- Object
- Sbire::AudioConverter
- Defined in:
- lib/sbire/audio_converter.rb
Instance Attribute Summary collapse
-
#pid_manager ⇒ Object
Returns the value of attribute pid_manager.
Instance Method Summary collapse
-
#initialize(pid_manager) ⇒ AudioConverter
constructor
A new instance of AudioConverter.
- #start(&block) ⇒ Object
- #stop ⇒ Object
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_manager ⇒ Object
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 |
#stop ⇒ Object
14 15 16 |
# File 'lib/sbire/audio_converter.rb', line 14 def stop pid_manager.kill(self) end |