•
•
•
•
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 391,709 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 3,383 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:
Views: 21030 | Replies: 8
![]() |
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,879
Reputation:
Rep Power: 32
Solved Threads: 107
#2
Jun 11th, 2003
What did you find? What you found DOES work but only in VB4? Are you looking for something for VB.NET ?
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Apr 2004
Location: minneapolis, mn
Posts: 35
Reputation:
Rep Power: 5
Solved Threads: 0
•
•
Join Date: Apr 2004
Location: minneapolis, mn
Posts: 35
Reputation:
Rep Power: 5
Solved Threads: 0
here's a module I used to play sounds. I don't remember how I did it with just the .wav fiile, but I THINK you can just put the name of the file in place of loadresdata. But in this example I have my .wav files saved in my resource file with id's of 101 and 102. If your app is always going to use the same set of sounds, I think this is the easiest way, and quicker. So to play the sound I just call MySounds(101) and it plays that file. Here's the snippet from a module:
Option Explicit
Public Declare Function sndPlaySound Lib _
"winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_MEMORY = &H4
Public Sub MySounds(intSound As Integer)
'101 is drums sound used for startup
'102 is bop sound used for going from form to form
sndPlaySound StrConv(LoadResData(intSound, "custom"), vbUnicode) _
, SND_ASYNC Or SND_MEMORY
DoEvents
End Sub
Option Explicit
Public Declare Function sndPlaySound Lib _
"winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_MEMORY = &H4
Public Sub MySounds(intSound As Integer)
'101 is drums sound used for startup
'102 is bop sound used for going from form to form
sndPlaySound StrConv(LoadResData(intSound, "custom"), vbUnicode) _
, SND_ASYNC Or SND_MEMORY
DoEvents
End Sub
•
•
•
•
Originally Posted by Stooge
bdiamond, any chance you could use sndPlaySound in a code snippet? I'm not sure how to employ it. thanks.
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
I see this is your first post, So, Welcome To Daniweb, and I hope you enjoy the site. One favor I am going to have to ask you, right off the bat, is not to piggy or resurrect ancient threads. This thread has been dead for a year, and it's best (and proper) to start your own thread if you have a question. Thanx, and I hope to be able to be of assistance to you.
•
•
Join Date: Aug 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Dear Spartan,
Having the same trouble trying to get vb.net 2005 to run midi files. I was referred to this link http://forums.msdn.microsoft.com/zh-...-b6ffab8596e8/
this forum might help you.
Having the same trouble trying to get vb.net 2005 to run midi files. I was referred to this link http://forums.msdn.microsoft.com/zh-...-b6ffab8596e8/
this forum might help you.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- Copying multiple files with Visual Basic (Visual Basic 4 / 5 / 6)
- I need suggestions for creating a Help system for a Visual Basic Program. (Visual Basic 4 / 5 / 6)
- Visual Basic and C++ and Debug and DLLs (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: My Program doesnt run, afer installing the setup file. Plz help.
- Next Thread: Vb crystal report 7.0 ver export



Linear Mode