class Serinette::SourceNoise
Sourced Noises; will provide noises sourced from wav files found in a particular directory
Constants
- SOUND_DIRECTORY
Public Class Methods
new()
click to toggle source
# File lib/serinette/source_noise.rb, line 7 def initialize init_wavefile end
pick_random_file()
click to toggle source
# File lib/serinette/source_noise.rb, line 16 def self.pick_random_file sound_files = Dir.glob(SOUND_DIRECTORY).sort num = (0..sound_files.length - 1).to_a.sample sound_files[num] end
Public Instance Methods
init_wavefile()
click to toggle source
# File lib/serinette/source_noise.rb, line 11 def init_wavefile sox = SoxWrapper.generate_and_run input: SourceNoise.pick_random_file @wavefile = sox.output.path end