Opened 20 years ago
Closed 20 years ago
#19 closed defect (fixed)
Implementing SoundEngine
Reported by: | patrick | Owned by: | simon |
---|---|---|---|
Priority: | minor | Milestone: | 0.3.0-pre-alpha orx-v0 |
Component: | Sound | Version: | |
Keywords: | Cc: | bensch | |
Referenced By: | References: |
Description
Interface to the sound card. You will use the SDL-Mixer and eventually some other libraries to decode compressed sound-files.
- requirements:
- playing background music
- managing a list of background music sounds, they can be played in this queue
- playing game sound-effects with a minimal delay
- playing sound/music with individual sound volumes
- use of compressed music/sound like mp3, ogg
- setting the background music volume and the sound effect volume indipendently
- fading away background music
- bonus: mixing two music tracks
- implementation:
- SoundEngine is a singleton class
- attribute: background sound-queue, containing all background sounds (List)
- init() function, that initializes and starts all SDL sound modules
- uninit() function, that free the SDL sound modules
- destroy() frees all resources
- playBackSoundList() function, to start playing the background music queue
- playBackSoundList(int tracNr) function to play a specific backsound in the list given as a number
- playBackSoundLoop(Sound* background) function to start playing the list one by one
- stopBackSound() function, to stop playing the background music
- pauseBackSound() function, to pause the background music
- playEffectSound(Sound* effect, float volume) function to play effect sound with individual effect volume
- playEffectSound(Sound* effect) function to play effect sound
- addBackSound() adds a back-sound to the internal queue
- removeBackSound() removes a back-sound from the internal queue
- clearBackSound() clears the back-sound list
- setBackVolume(float) [0, 1] function to set the background volume, values between [0,1]
- setEffectVolume(float) [0, 1] function to set the sound effect volume, values between [0,1]
- what you have to think about:
- sounds happening far away (explosions etc) should have a lower volume, is this possilbe?
- sound format to use, we prefere open source formats, keep this in mind
- proposed work flow:
- read some stuff on the internet about this topics, namly:
- SDL_mixer, sound channels, mixer, volumes, supported sound formats, performance needs
- mp3, ogg, wav sound formats and other you might find
- look at some examples on the net and make your own. develop a test environment that comes close to the requirements
- implement the framework for the SoundEngine, just the function bodies
- make some short doxygen tags. you can use the short descriptions i made under implementation
- implement the SoundEngine
- test it, also on the other computer platforms
- read some stuff on the internet about this topics, namly:
Change History (3)
comment:1 Changed 20 years ago by simon
- Owner changed from nobody to simon
- Status changed from new to assigned
comment:2 Changed 20 years ago by patrick
- Cc bensch added
- Milestone changed from feature-taks to 0.3.0-pre-alpha
comment:3 Changed 20 years ago by bensch
- Resolution set to fixed
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.
everything but the ogg-player