Class l2df.manager.sound

Last updated 2021-05-28 15:24:22

Sound manager

Info:

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:

    l2df.manager.sound
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
Manager:isPlaying(source)
Check if source is a currently playing music.

Parameters:

  • source love.audio.Source Music userdata source.

Returns:

    boolean
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)
Manager:stop([sources])
Stop all or list of playing sources / music.

Parameters:

  • sources {love.audio.Source,...} (optional)
Manager:update()
Play all queued sounds.

Fields

Manager.sound_volume number
Sounds volume.
Manager.music_volume number
Music volume.