Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No sound when packaged

Status
Not open for further replies.

mbrink

Technical User
Jul 5, 2002
13
US
Here is the code I've been using to play sounds:

In a module:
Public SoundOption As Boolean

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

To play it:
Call sndPlaySound(App.Path + "\Player1.wav", SND_SYNC)


It works fine when running in VB and when I just make the executable. But as soon as I package and install, I get no sound. I've tried packaging it so it installs all the sound files and still nothing.

What am I missing?

Michael
 

prior to calling this did you use the waveOutGetNumDevs API to see if there are any sound devices on the system. Are the speakers turned on/plugged in. Has the software been muted or turned down? Do you see your files in the app.path from the install?

Good Luck


 
Yes the speakers are fine. I run the straight-compiled exe and it works. Turn around on the same machine and run the packaged and installed version and it doesn't play the sounds. The sound files do get installed to the same folder as the program. As far as the waveOutGetNumDevs API, I haven't ever used it, so don't know how, but if all it does is check to see if sound devices exist, it shouldn't matter in this case.
 

The only other thing I can offer is ... do you have an error handler in your sub that plays the sound? If not put one in with a message box for the error and for a test put in a message box right after you play the sound to make sure that the code is being used.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top