Ok, here is what I have for the sound module called "Sound". (Ya, I know. Real creativity in the name.)
All these functions can be accessed from anywhere in the program useing "Sound.functionname()"
There are 3 sound devieces: Background, Voice, and SFx. This allows for 3 seperate sounds to be played and modified at once.
Here are the constence create by the module: (You will see how these are used in the functions)
Code: Select all
BGSnd As Integer = 0
VSnd As Integer = 1
SFSnd As Integer = 2
The first sub is only used once. And it is only used when the game is loaded.
Code: Select all
Public Sub Init(ByRef SBG As AxWMPLib.AxWindowsMediaPlayer, ByRef SV As AxWMPLib.AxWindowsMediaPlayer, ByRef Sfx As AxWMPLib.AxWindowsMediaPlayer)
Here are the functions that you can use to load and minipulate sounds
LoadSound(ByVal SoundThread As Integer, ByVal FileLocation As String)
SoundThread is one of the three constence that you use to choose which 'sound' you want to load the file into.
FileLocation is the location of the file that you want to load.
This loads a file into the Sound Channel (I am just going to call the there channels from now on) but does not start it.
StartSound(ByVal SoundThread As Integer)
This starts playing a sound that was loaded into the channel
StopSound(ByVal SoundThread As Integer)
This stops a sound that is playing in the channel
PlaySound(ByVal SoundThread As Integer, ByVal FileLocation As String)
This loads and starts a sound in the channel from the file location
LoopSound(ByVal SoundThread As Integer)
This sets it so that any sound in that channel will continue to loop. This is pretty much just used in the Background channel.
StopLoopingSound(ByVal SoundThread As Integer)
This sets it so the sound in the channel will only play once
Volume controls:
FadeOut(ByVal SoundThread As Integer, ByVal Time As Double)
This cuases the sound in the channel to fade to silent in
Time seconds
FadeIn(ByVal SoundThread As Integer, ByVal Time As Double)
This cuases the sound in the channel to fade from silent to its nomal volume in
Time seconds
SetVolume(ByVal SoundThread As Integer, ByVal Volume As Integer)
This sets the volume in the channel to
Volume, a value between 0 and 100
Mute(ByVal SoundThread As Integer)
This mutes the sound in the channel, but it continues to play
UnMute(ByVal SoundThread As Integer)
This unmutes the sound in the channel.
That is it. I just relized that I forgot to add
Pause but you can already guess what that will look like and how it will act.
Anything else you would like to see?