Sound Engine Evaluation for Computer Games - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Sound Engine Evaluation for Computer Games

Description:

Reverb and other DSP FX (e.g., room effects) Pre-load to avoid delay in first play ... Get/SetMinMaxDistance (min is the distance where the sound starts to attenuate) ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 15
Provided by: melod6
Category:

less

Transcript and Presenter's Notes

Title: Sound Engine Evaluation for Computer Games


1
Sound Engine Evaluation for Computer Games
  • Case Study fmod
  • Jyun-Ming Chen

2
Typical Game Loop
  • Roles of music/sound
  • BGM (background music)
  • Sound effect

3
Microsoft SDK
Need more sophisticated tools!
  • BGM (Midi)
  • mciSendCommand ()
  • Sound (Wave)
  • sndPlaySound
  • See msdn for details
  • Ex midi_wav.zip on webhd2/game-ex

4
Check List
  • BGM
  • File formats supported mid, mp3, mod,
  • Looping
  • Early termination
  • Volume control
  • Sound effects
  • File formats supported
  • Trigger mechanism
  • Reverb and other DSP FX (e.g., room effects)
  • Pre-load to avoid delay in first play
  • General
  • Mixing capability (how many sounds can be mixed
    at one time)
  • Spatial sound
  • Position 3D vs. panning
  • Velocity Doppler supported?
  • Occlusion?!
  • Sync capability
  • sound to action
  • Action to sound
  • Others
  • CPU overhead

5
Case Study fmod
  • Cross platform audio library (Win32, Linux, mac,
    WinCE, PS2, Xbox, )
  • Free unless for commercial use

6
Documentation
FSOUND for sound effect
FMUSIC for bgm
7
FSOUND API
8
Initialization
Required for both FMUSIC FSOUND
9
FSOUND_Sample
  • Load, Free
  • SetMode LOOP normal bidi off
  • Get/SetLoopPoints
  • GetLength
  • Get/SetMinMaxDistance (min is the distance where
    the sound starts to attenuate)
  • increase the min_distance of a sound to make it
    'louder' in a 3d world, and decrease it to make
    it 'quieter' in a 3d world.

10
FSOUND_Stream
  • If the PCM data (wav) or compressed file (ogg,
    mp3, ) is too big to be read in as a sample, we
    can use stream functions to read it (decompress
    it on-the-fly)
  • Certain functionalities are restricted

11
Channel Functions
  • FSOUND_PlaySound, PlaySoundEx
  • FSOUND_FREE Choose a free channel to play in
  • Returns the channel selected
  • Extended version can play paused (allow
    attributes to be changed, then play)
  • FSOUND_SetFrequency (channel, 11025)
  • FSOUND_SetVolume(channel, 255)
  • FSOUND_SetPan(channel, 255)
  • FSOUND_SetPaused(channel, FALSE)
  • FSOUND_StopSound

12
3d
  • FSOUND_Update()
  • This updates the 3d sound engine, and should be
    called once a game frame.

13
Listener Attributes
  • Pos
  • Vel (per second)
  • Fx, fy, fz (forward orientation vector)
  • Tx, ty, tz (top-up orientation vector)
  • Fmod uses left-hand coordinate system

14
FMUSIC (mid, mod mp3)
  • LoadSong
  • PlaySong can play more than one music (yes, but
    why?)
  • SetPaused
  • SetLooping default TRUE
  • SetPanSeparation, SetMasterSpeed, SetMasterVolume
  • StopSong, StopAllSongs
  • FreeSong
  • SetReverb (midi only)
Write a Comment
User Comments (0)
About PowerShow.com