Game sound effects

From FreeGameDevWiki
Jump to: navigation, search

The use of sound effects in games allows to create atmosphere (eg. scary or happy sounds) or to convey information (directional sounds) and can even become a central topic of a game.[1]

Implementation

Sound effects audio files are often decoded to memory before playing.[2][3] This prevents undesired lags between game action and according sound.

Variation

By having slightly variating versions of a sound, repetitive audio (for example foot steps) can be prevented from becoming annoying. The difference between sounds should be slight, otherwise it might suggest to the player that the difference occurred due to a different action and be confusing this way.

A pseudocode implementation of a random sound player:

listOfSounds = ( 0 = loadSoundFile("step1.wav"), 1 = loadSoundFile("step2.wav"), 2 = loadSoundFile("step3.wav") )

function playSound
  soundToPlay = random( 0, ( listOfSounds.length() - 1) )
  playSound( listOfSounds[soundToPlay] )
end function

Procedural generation

An alternative to recording or manual synthesizing of sounds is the procedural generation of sounds, either real-time or for recording to files.

Phya

Dylan Menzies' physical audio library Phya analyzes a sound recording and creates physically calculated variations of it.

Pure Data

Andy Farnell describes how to hook Pure Data, a graphical programming language for generating audio, into a game for game sound prototyping. Synthesizers are also provided.

sfxr

Dr. Petter's sfxr application generates simple game sounds that can be manipulated by using sliders or by pressing randomization buttons. The results can be saved as WAV files.

Resources

Web sites of freely licensed game sound effects
Site name/link Sounds Details Status File formats Licenses
OLPC Sound Samples 8458 Mostly instruments Archive wav CC-BY 3.0
OpenGameArt Sounds 324 (many packs) Most are game-ready Active flac, ogg, wav Various free
public domain sounds (backup) 673 Mostly raw recordings Archive flac, mp3 PD
SoundBible unknown Archive wav CC-BY 3.0 and non-free (no automatic filter)

References

  1. Be The Wumpus an audio-only game
  2. LÖVE documentation: Sound
  3. Pyglet documentation: Playing sound and music