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