Skip to content
davewx7 edited this page Jul 24, 2016 · 1 revision

To see what sounds are being played type logsounds from the debug console. All sound events will be logged on-screen.

To generate a sound event from within FFL code, use this:

lib.sound.play_sound(me, 'gameplay/sound_name')

The 'me' is given so that the system knows which object is generating the sound. This will generate a sound event and search for all .wav files inside the sounds/gameplay/ folder which begin with sound_name. One matching sound will be chosen at random and played. This lets us easily add variations of sounds and have one chosen and played at random.

If there are no matching .wav files no sound will play but it will still print a message in logsounds to indicate an attempt to play the sound. So the first step in debugging a sound that isn't playing is to see if it shows up in logsounds.

logsounds allows you to adjust the volume and delay of sounds. These values are stored in data/sound-volume.cfg and data/sound-delay.cfg

Clone this wiki locally