Okay, now that the sound module works I shall describe its functions and actions. It automatically retrieves a resource value for the sound. I have tested it with the menu audio and it works fine, so long as you use WAV files. I will be expanding this to OGG and MP3 soon.
Anyway, here is a list of commands:
SND_Init() - Initializes the sound module.
SND_Update() - Performs any updates. If this is not called, sounds will not start, or end.
SND_Terminate() - Pretty obvious, I think.
Result = SND_LoadSound(SoundFile$) - Load a sound file into the module. It will retrieve all the other data it needs. The result is the resource value which it obtains automatically.
SND_DeleteSound(SoundNumber) - Unload a sound. The SoundNumber is the resource number or Result value from SND_LoadSound().
Result = PlaySound(SoundNumber) - Plays the sound using your sound number. If the sound is already playing, it will reload the sound temporarily to play it. The result will be the resource value of the newly loaded sound, so you can stop it early if required. Note: the newly loaded sound will be automatically deleted when it finishes playing.
Result = LoopSound(SoundNumber) - The same as PlaySound(), but for looping sounds.
StopSound(SoundNumber) - Also quite obvious.
MuteSound() - Absolutely no sound output from audio controlled in module. Affects ALL sounds.
UnMuteSound() - Remove the mute.
SetSoundVolume(SoundNumber, Volume) - Set the current volume of a sound.
SetSoundVolumeTarget(SoundNumber, VolumeTarget) - Define a volume which the volume will fade to.
SetSoundSpeed(SoundNumber, Speed) - Set the speed at which the sound will be played.
SetSoundSpeedTarget(SoundNumber, SpeedTarget) - Allows for pitch slides.