0

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?

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.