| | |
applying audio sounds in vb
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2008
Posts: 36
Reputation:
Solved Threads: 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?
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?
•
•
Join Date: Apr 2007
Posts: 106
Reputation:
Solved Threads: 16
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
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
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: generating a reminder in VB
- Next Thread: how to put uploading picture to the application database.
Views: 804 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






