Class: AudioStream::SoundInfo

Inherits:
RubyAudio::SoundInfo
  • Object
show all
Defined in:
lib/audio_stream/sound_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bpmObject

Returns the value of attribute bpm.



4
5
6
# File 'lib/audio_stream/sound_info.rb', line 4

def bpm
  @bpm
end

#bpsObject (readonly)

Returns the value of attribute bps.



5
6
7
# File 'lib/audio_stream/sound_info.rb', line 5

def bps
  @bps
end

#window_sizeObject

Returns the value of attribute window_size.



3
4
5
# File 'lib/audio_stream/sound_info.rb', line 3

def window_size
  @window_size
end

Instance Method Details

#cloneObject



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

def clone
  SoundInfo.new(channels: channels, samplerate: samplerate, format: format, window_size: window_size, bpm: bpm)
end

#framerateObject



7
8
9
# File 'lib/audio_stream/sound_info.rb', line 7

def framerate
  self.samplerate.to_f / self.window_size
end

#sync_rateObject



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

def sync_rate
  self.samplerate.to_f / self.bps
end