Class: MG::Audio
- Inherits:
-
Object
- Object
- MG::Audio
- Defined in:
- doc/API_reference.rb
Instance Attribute Summary collapse
-
#duration ⇒ Float
readonly
The duration left in the sound file.
Constructors collapse
-
.play(path, loop = false, volume = 1.0) ⇒ Audio
Creates a new Audio object based on a sound file at the given path and immediately plays it.
Instance Method Summary collapse
-
#current_position ⇒ Float
The position where to play the sound file.
-
#current_position=(value) ⇒ Object
Set the position where to play the sound.
-
#loop=(value) ⇒ Object
Set whether to loop the sound.
-
#loop? ⇒ Boolean
Whether the sound file should loop.
-
#pause ⇒ self
Pauses the sound file.
-
#paused? ⇒ Boolean
Whether the sound file is being paused.
-
#playing? ⇒ Boolean
Whether the sound file is being played.
-
#resume ⇒ self
Resumes playing the sound file.
-
#stop ⇒ self
Stops the sound file.
-
#volume ⇒ Float
The volume of the sound file, from a 0.0 to 1.0 Float range.
-
#volume=(value) ⇒ Object
Set the volume of the sound.
Instance Attribute Details
#duration ⇒ Float (readonly)
Returns the duration left in the sound file.
406 407 408 |
# File 'doc/API_reference.rb', line 406 def duration @duration end |
Class Method Details
.play(path, loop = false, volume = 1.0) ⇒ Audio
Creates a new Audio object based on a sound file at the given path and immediately plays it.
379 |
# File 'doc/API_reference.rb', line 379 def self.play(path, loop=false, volume=1.0); end |
Instance Method Details
#current_position ⇒ Float
Returns the position where to play the sound file.
399 |
# File 'doc/API_reference.rb', line 399 def current_position; end |
#current_position=(value) ⇒ Object
Set the position where to play the sound.
403 |
# File 'doc/API_reference.rb', line 403 def current_position=(value); end |
#loop=(value) ⇒ Object
Set whether to loop the sound.
389 |
# File 'doc/API_reference.rb', line 389 def loop=(value); end |
#loop? ⇒ Boolean
Returns whether the sound file should loop.
385 |
# File 'doc/API_reference.rb', line 385 def loop?; end |
#pause ⇒ self
Pauses the sound file.
414 |
# File 'doc/API_reference.rb', line 414 def pause; end |
#paused? ⇒ Boolean
Returns whether the sound file is being paused.
424 |
# File 'doc/API_reference.rb', line 424 def paused?; end |
#playing? ⇒ Boolean
Returns whether the sound file is being played.
421 |
# File 'doc/API_reference.rb', line 421 def ; end |
#resume ⇒ self
Resumes playing the sound file.
410 |
# File 'doc/API_reference.rb', line 410 def resume; end |
#stop ⇒ self
Stops the sound file.
418 |
# File 'doc/API_reference.rb', line 418 def stop; end |
#volume ⇒ Float
Returns the volume of the sound file, from a 0.0 to 1.0 Float range.
392 |
# File 'doc/API_reference.rb', line 392 def volume; end |
#volume=(value) ⇒ Object
Set the volume of the sound.
396 |
# File 'doc/API_reference.rb', line 396 def volume=(value); end |