Class: Sbire::AudioRecorder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, pid_manager) ⇒ AudioRecorder

Returns a new instance of AudioRecorder.



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

def initialize(path, pid_manager)
  @path = path
  @pid_manager = pid_manager
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

#pid_managerObject

Returns the value of attribute pid_manager.



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

def pid_manager
  @pid_manager
end

Instance Method Details

#startObject



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

def start
  pid = record_audio
  pid_manager.store(self, pid)
end

#stopObject



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

def stop
  pid_manager.kill(self)
end