Class: Sound

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

Overview

sound.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Sound

Returns a new instance of Sound.



5
6
7
# File 'lib/r2d/sound.rb', line 5

def initialize(path)
  @sound = R2D::Adapters.sound(path)
end

Instance Method Details

#pauseObject



17
18
19
# File 'lib/r2d/sound.rb', line 17

def pause
  @sound.pause
end

#paused?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/r2d/sound.rb', line 25

def paused?
  @sound.paused?
end

#playObject



9
10
11
# File 'lib/r2d/sound.rb', line 9

def play
  @sound.play
end

#play_loopObject



13
14
15
# File 'lib/r2d/sound.rb', line 13

def play_loop
  @sound.play(true)
end

#playing?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/r2d/sound.rb', line 21

def playing?
  @sound.playing?
end

#stopObject



29
30
31
# File 'lib/r2d/sound.rb', line 29

def stop
  @sound.stop
end

#volumeObject



33
34
35
# File 'lib/r2d/sound.rb', line 33

def volume
  @sound.volume
end