Class l2df.manager.sound
Sound manager
Info:
- Copyright: Atom-TM 2020
- Author: Kasai
Functions
Manager:init([kwargs]) | Configure SoundManager. |
Manager:setMusic(source[, looping=false]) | Set background music. |
Manager:isPlaying(source) | Check if source is a currently playing music. |
Manager:play(input) | Add sound to queue for playing. |
Manager:stop([sources]) | Stop all or list of playing sources / music. |
Manager:update() | Play all queued sounds. |
Fields
Manager.sound_volume | Sounds volume. |
Manager.music_volume | Music volume. |
Functions
Methods- Manager:init([kwargs])
-
Configure SoundManager.
Parameters:
-
kwargs
table
Keyword arguments.
- sound number Sounds volume. Value should be in range [0.0; 1.0]. (default 0.7)
- music number Music volume. Value should be in range [0.0; 1.0]. (default 0.3)
Returns:
-
kwargs
table
Keyword arguments.
- Manager:setMusic(source[, looping=false])
-
Set background music.
Parameters:
-
source
love.audio.Source
Music
userdata
source for playing. - looping boolean True if the background music should be looped. False otherwise. (default false)
Returns:
-
boolean
-
source
love.audio.Source
Music
- Manager:isPlaying(source)
-
Check if source is a currently playing music.
Parameters:
-
source
love.audio.Source
Music
userdata
source.
Returns:
-
boolean
-
source
love.audio.Source
Music
- Manager:play(input)
-
Add sound to queue for playing.
Parameters:
-
input
table or love.audio.Source
Sound
userdata
source.-
resource
love.audio.Source
Sound
userdata
source if input was passed as table. (optional) -
volume
love.audio.Source
Sound volume. Value should be in range [0.0; 1.0].
Defaults to SoundManager.sound_volume or
1
. (default 1)
-
resource
love.audio.Source
Sound
-
input
table or love.audio.Source
Sound
- Manager:stop([sources])
-
Stop all or list of playing sources / music.
Parameters:
- sources {love.audio.Source,...} (optional)
- Manager:update()
- Play all queued sounds.