Teek::SDL2::Music Class
Streaming music playback for longer audio files (MP3, OGG, WAV).
Only one Music track can play at a time (SDL2_mixer limitation).
For short sound effects that can overlap, use Sound instead.
Inherits: Object
Instance Methods ↑
initialize(path)
Load a music file (MP3, OGG, WAV). Initializes the mixer automatically.
Parameters
pathString— path to the music file
play(loops: -1, fade_ms: 0)
Start playing the music. Only one music track plays at a time.
Parameters
loopsInteger— -1 = loop forever (default), 0 = play once, N = play N extra timesfade_msInteger— fade-in duration in milliseconds (0 = no fade)
Returns nil