applying audio sounds in vb

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2008
Posts: 36
Reputation: lerkei is an unknown quantity at this point 
Solved Threads: 0
lerkei lerkei is offline Offline
Light Poster

applying audio sounds in vb

 
0
  #1
Jan 26th, 2008
can anyone give a sample code for applying sounds on vb..
thanks.. i already applied a code but it wont work..

Public MTime As Byte

MMControl1.FileName = App.Path & "\music\Music.mid"

Private Sub Timer4_Timer()
MTime = MTime + 1
If MTime = 113 Then
ShutYerNoise
Play
MTime = 0
End If
End Sub

Sub Play()
MMControl1.Command = "Open"
MMControl1.Command = "Play"
Timer4.Enabled = True
End Sub


Sub ShutYerNoise()
MMControl1.Command = "Stop"
MMControl1.Command = "Close"
Timer4.Enabled = False
End Sub

what's wrong with this?..anyone?
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 106
Reputation: SCBWV is an unknown quantity at this point 
Solved Threads: 16
SCBWV SCBWV is offline Offline
Junior Poster

Re: applying audio sounds in vb

 
0
  #2
Jan 26th, 2008
First of all, you declared MTime as Byte when you're using it as an integer. Secondly, why not just use the Timer event instead of MTime?

Private Sub Form_Load()
MMControl1.Command = "Open"
MMControl1.Command = "Play"
End Sub

Private Sub Timer1_Timer()
MMControl1.Command = "Stop"
MMControl1.Command = "Close"
MMControl1.Command = "Open"
MMControl1.Command = "Play"
End Sub
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 36
Reputation: lerkei is an unknown quantity at this point 
Solved Threads: 0
lerkei lerkei is offline Offline
Light Poster

Re: applying audio sounds in vb

 
0
  #3
Jan 27th, 2008
Ok..thanks..i'm already done with it...=)
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: applying audio sounds in vb

 
1
  #4
Jan 27th, 2008
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 804 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC