Class | Rubygame::Mixer::Music |
In: |
lib/rubygame/deprecated_mixer.rb
lib/rubygame/deprecated_mixer.rb |
Parent: | Object |
**NOTE:** This class is DEPRECATED and will be removed in Rubygame 3.0. Please use the Rubygame::Music class instead.
The Music class is used for playing music from a file. It supports WAVE, MOD, MIDI, OGG, and MP3 files. There are two important differences between Music and Sample:
**NOTE:** Rubygame::Mixer::Music is DEPRECATED and will be removed in Rubygame 3.0. Please use the Rubygame::Music class instead.
Load music from a file. Supports WAV, MOD, MIDI, OGG, and MP3 formats.
Raises SDLError if the music could not be loaded.
**NOTE:** Rubygame::Mixer::Music is DEPRECATED and will be removed in Rubygame 3.0. Please use the Rubygame::Music class instead.
Load music from a file. Supports WAV, MOD, MIDI, OGG, and MP3 formats.
Raises SDLError if the music could not be loaded.
Play the music, fading in and repeating a certain number of times. See also play.
Raises SDLError if something goes wrong.
fade_time: | Time in seconds for the fade-in effect to complete. |
repeats: | Number of extra times to play through the music. -1 plays the music forever until it is stopped. Defaults to 0, play only once (no repeats). |
start: | Time to start from, in seconds since the beginning. Defaults to 0, the beginning of the song. Non-zero values only work for OGG and MP3; other music types will raise SDLError. |
Play the music, fading in and repeating a certain number of times. See also play.
Raises SDLError if something goes wrong.
fade_time: | Time in seconds for the fade-in effect to complete. |
repeats: | Number of extra times to play through the music. -1 plays the music forever until it is stopped. Defaults to 0, play only once (no repeats). |
start: | Time to start from, in seconds since the beginning. Defaults to 0, the beginning of the song. Non-zero values only work for OGG and MP3; other music types will raise SDLError. |
Gradually fade the music to silence over fade_length seconds. After the fade is complete, the music will be automatically stopped.
Raises SDLError if something goes wrong.
fade_time: | Time until the music is totally silent, in seconds. |
Gradually fade the music to silence over fade_length seconds. After the fade is complete, the music will be automatically stopped.
Raises SDLError if something goes wrong.
fade_time: | Time until the music is totally silent, in seconds. |
True if the music is fading in or out (or either). You can specify direction as :in/:out to check only fading in/out; otherwise, it will return true if it‘s fading either way.
direction: | :in, :out, or nil if you don‘t care which. |
Returns: | true if the music is fading in the given direction. |
True if the music is fading in or out (or either). You can specify direction as :in/:out to check only fading in/out; otherwise, it will return true if it‘s fading either way.
direction: | :in, :out, or nil if you don‘t care which. |
Returns: | true if the music is fading in the given direction. |
Pause playback of the playing music. You can later resume playback from the point where you paused. Safe to use on already-paused music. See also play_music.
Pause playback of the playing music. You can later resume playback from the point where you paused. Safe to use on already-paused music. See also play_music.
Play music, repeating a certain number of extra times. If any music was already playing, that music will be stopped first, and this music will start.
Raises SDLError if something goes wrong.
This method takes these arguments:
repeats: | how many extra times to play the music. Can be -1 to repeat forever until it is stopped. |
Play music, repeating a certain number of extra times. If any music was already playing, that music will be stopped first, and this music will start.
Raises SDLError if something goes wrong.
This method takes these arguments:
repeats: | how many extra times to play the music. Can be -1 to repeat forever until it is stopped. |
Resume playback of paused music from the point it was paused. Safe to use on already-playing music. See also play.
Resume playback of paused music from the point it was paused. Safe to use on already-playing music. See also play.
Rewind the music to the start. This is safe to use on stopped, paused, and playing music. Only works for MOD, OGG, MP3, and MIDI (but not WAV).
Rewind the music to the start. This is safe to use on stopped, paused, and playing music. Only works for MOD, OGG, MP3, and MIDI (but not WAV).