Anyone mind telling me what's wrong in this code?
VB Code:
REM Play a sound Public Function PlaySound(ByVal Filename As String, Optional ByVal optPlayCount As Integer = 1, Optional ByVal optVolume As Integer = 100) As Boolean Dim x As New AxWMPLib.AxWindowsMediaPlayer Try x.URL = Filename x.settings.playCount = optPlayCount x.settings.volume = optVolume x.Ctlcontrols.play() Catch ex As Exception 'An error occured Return False Exit Function End Try 'Sound played successfully Return True End Function




Reply With Quote