|
| MobileDragon SoundSystem class provides API for loading & playing .mod ProTracker music files and .wav sound files (8 and 16 bits per sample uncompressed and Microsoft ADPCM compressed mono and stereo WAV files are supported). Mono & stereo playback is supported. It also supports virtually unlimited amount of playback channels. You can add music and sound playback with 6 lines of
code: //Initialize
the sound system: This will initialize SoundSystem to 22100 Hz, 8 bits per sample, stereo output with 2 mod music channels and 8 wav sound channels, giving SoundSystem object a pointer the to PackDir object from which SoundSystem will load resources. //
Load music .mod file & start it’s playback. //
Load sound .wav file & start it’s playback. Music as well as sounds can be looped, paused and then
resumed if needed. //
Pause the music Music and sounds can be stopped. If they were stopped the next Play() function will start it from the very beginning. //
Stop the music You can also stop, pause and resume all music and sound available by using StopAll(), PauseAll() and ResumeAll() functions accordingly. To set sound system volume you can use SetGlobalSoundVolume( DWord sound_volume ) and SetGlobalMusicVolume( DWord music_volume ) fuctions. There is a way to change each sound or music volume individually by using SetVolume( DWord volume ) function. Volume parameter varies between 0 and 64, where 0 means silence and 64 is the highest volume. You can adjust panning and speed using SetPan( DWord pan ) and SetSpeed( DWord speed ) functions accordingly. In these functions pan and speed are values between 0 and 255. 128 means normal speed and center panning.
Copyright 2005-2006 Herocraft Hitech Co. Ltd. |