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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Playing .WAV files

Status
Not open for further replies.

Yazster

Programmer
Sep 20, 2000
175
CA
I have an application I programmed using VB5 and wanted to add sounds to it. I used the following declaration:

Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

This works fine, but the problem I'm having is that when I play a .WAV file, my program waits for the sound to stop before continuing. Is there a way to play a .WAV file and have execution continue even while the sound is playing?

Thanks,
Yazster
 
One of the ByVal "dwFlags" As Long is for Asyncronous play. Don't remember the syntax, however
 
Also you can use ActiveX controls like Windows Media Player, if you are sure it is installed on clients.
Mohammad Mehran Nikoo, MCP
mohmehran@yahoo.com
 
Theoretically... putting a 'DoEvents' clause before the 'PlaySound' function call should allow your VB program to continue execution while the sound's playing back. Haven't tried this personally, but it may be worth giving it a shot!
Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top