wav sound player class

This is a visual basic 6.0 wav sound player class that plays any selected sound file in .wav format. It has the filename property to select the file and play property to play the sound file.

'*******************************************************
'*     MYCPLUS Sample Code - https://www.mycplus.com     *
'*                                                     *
'*   This code is made available as a service to our   *
'*      visitors and is provided strictly for the      *
'*               purpose of illustration.              *
'*                                                     *
'* Please direct all inquiries to saqib at mycplus.com *
'*******************************************************

Option Explicit
Private mfilename As String
Private mflags As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


Public Property Get filename() As String
 filename = mfilename
End Property

Public Property Let filename(ByVal vnewvalue As String)
 mfilename = vnewvalue
End Property

Public Property Get flags() As Long
 flags = mflags
End Property

Public Property Let flags(ByVal vnewvalue As Long)
 mflags = vnewvalue
End Property

Public Sub play()
 Dim rc As Long
 rc = sndPlaySound(mfilename, mflags)
End Sub
M. Saqib: Saqib is Master-level Senior Software Engineer with over 14 years of experience in designing and developing large-scale software and web applications. He has more than eight years experience of leading software development teams. Saqib provides consultancy to develop software systems and web services for Fortune 500 companies. He has hands-on experience in C/C++ Java, JavaScript, PHP and .NET Technologies. Saqib owns and write contents on mycplus.com since 2004.
Related Post