Sounds and Music
-
Hi! I'm totally new in VB.net... I bought The VB.net Deluxe Learning Edition 2003 kit... I may not be done with it (almost though) but as I skimmed through the book I noticed that it does NOT show you how to play sounds and music... (I'm not usre if it even teaches you Avis!) I was just wondering what object do i need to use to open and play sonds and music... Or if there is no object... HOW DO YOU DO IT?! BTW: I looked aeverywhere for the answer already... Thnx :confused:
-
Hi! I'm totally new in VB.net... I bought The VB.net Deluxe Learning Edition 2003 kit... I may not be done with it (almost though) but as I skimmed through the book I noticed that it does NOT show you how to play sounds and music... (I'm not usre if it even teaches you Avis!) I was just wondering what object do i need to use to open and play sonds and music... Or if there is no object... HOW DO YOU DO IT?! BTW: I looked aeverywhere for the answer already... Thnx :confused:
For sound, use the sndPlaySound() API. For video, use the Windows Media Player control or something similar.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi -
For sound, use the sndPlaySound() API. For video, use the Windows Media Player control or something similar.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhian old example in .net i did for someone a few months ago , might give you a helping hand with the sound
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Integer) As Long
Const SND_SYNC As Integer = &H0
Const SND_ASYNC As Integer = &H1
Const SND_NODEFAULT As Integer = &H2
Const SND_LOOP As Integer = &H8
Const SND_NOSTOP As Integer = &H10
Dim SoundName As String, wFlags As Integer, x As StringPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SoundName = "C:\Documents and Settings\Den\My Documents\Visual Studio Projects\WindowsApplication1\beav_rap.wav"
wFlags = SND_ASYNC Or SND_NODEFAULT
x = sndPlaySound(SoundName, wFlags)End Sub
Private void ExpectingTwins(string twins)
{
switch(twins)
{
Case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
}
}