User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 374,512 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,878 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Feb 3rd, 2006
Views: 14,123
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. Visit http://www.mycplus.com for more codes.
visualbasic Syntax
  1. Option Explicit
  2. Private mfilename As String
  3. Private mflags As Long
  4. Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  5.  
  6.  
  7. Public Property Get filename() As String
  8. filename = mfilename
  9. End Property
  10.  
  11. Public Property Let filename(ByVal vnewvalue As String)
  12. mfilename = vnewvalue
  13. End Property
  14.  
  15. Public Property Get flags() As Long
  16. flags = mflags
  17. End Property
  18.  
  19. Public Property Let flags(ByVal vnewvalue As Long)
  20. mflags = vnewvalue
  21. End Property
  22.  
  23. Public Sub play()
  24. Dim rc As Long
  25. rc = sndPlaySound(mfilename, mflags)
  26. End Sub
Comments (Newest First)
msaqib | Junior Poster in Training | Dec 25th, 2007
Actually that is the implementation of a class module in VB, to play a specified file you will need to import this class into your project and then set the property filename to the files you want to play.
karthik_02 | Newbie Poster | Mar 4th, 2007
how to select the file what we want..
where we have to place the code..
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 2:27 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC