Utility code for mixers and sound effects.
effectshandler
Utility code for basic management of mixers and sound effects.
Typical usage scenario:
During program initialization:
ehInitEffectsHandler()
to allocate and initialize the effects handler.ehNewMixerInfo()
to load a mixer and initialize a mixerInfo structure.ehLoadSoundEffect()
to load a sample as a sound effect and initialize a sampleInfo structure.ehSetChannelLevels()
for each sound effect.As needed during execution:
ehSetChannelLevels()
for a given sound effect to adjust its player's output levels. Issue calls which control the sound effects player instrument (the SampleInfo's si_Player structure member).During program termination:
ehDisposeSampleInfo()
for each sound effect.ehDisposeMixerInfo()
for the mixer.ehKillEffectsHandler()
. Close the audio folio.
Depending on program requirements, you may want to load one or more sound effects and assemble their player apparati but not immediately connect them to a mixer. This is accomplished by calling ehNewSampleInfo()
and ehSetupSamplePlayer()
. When you want to connect the player to the mixer, call ehConnectSamplePlayer()
.
This program is not a complete sound management facility.
effectshandler.c effectshandler.h
examples/ExamplesLib