Class: DXRubyRP5::Sound
- Inherits:
-
Object
- Object
- DXRubyRP5::Sound
- Defined in:
- lib/dxruby_rp5/sound.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ Sound
constructor
A new instance of Sound.
- #play ⇒ Object
- #set_volume(volume, time = 0) ⇒ Object
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
#play ⇒ Object
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 |