Class: DXRubyRP5::Sound

Inherits:
Object
  • Object
show all
Defined in:
lib/dxruby_rp5/sound.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Sound

Returns a new instance of Sound.



12
13
14
# File 'lib/dxruby_rp5/sound.rb', line 12

def initialize(filename)
  @_sound = self.class.send(:minim).load_file(filename)
end

Instance Method Details

#playObject



16
17
18
19
20
21
# File 'lib/dxruby_rp5/sound.rb', line 16

def play
  # TODO: loop
  @_sound.play
  @_sound.rewind
  return self
end

#set_volume(volume, time = 0) ⇒ Object



23
24
# File 'lib/dxruby_rp5/sound.rb', line 23

def set_volume(volume, time = 0)
end