ChaiLove API  0.28.0
Public Member Functions
love::sound Class Reference

This module is responsible for decoding sound files. More...

Public Member Functions

Types::Audio::SoundDatanewSoundData (const std::string &filename)
 Creates a new SoundData. More...
 

Detailed Description

This module is responsible for decoding sound files.

It can't play the sounds, see love.audio for that.

Member Function Documentation

◆ newSoundData()

Types::Audio::SoundData* love::sound::newSoundData ( const std::string &  filename)

Creates a new SoundData.

Supported file types include:

  • WAV
  • OGG
Parameters
filenameThe file name of the file to load.
Returns
A new SoundData object, NULL if loading failed.
global boom
def load() {
boom = love.sound.newSoundData("boom.wav")
}
def joystickpressed(joystick, button) {
love.audio.play(beat)
}