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

Playing tones through the conmputer speaker

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
I have a set of APIs for the original VisualBasic (before they even had a version number) that played tones of different pitch and duration through the speaker. They worked with MSAccess version 2 but dont work with VB6 (error message says it cant find the reference in the DLL)
Anybody any ideas on how to do it with VCB6?
 
Hi,
Try using DirectX.

'*** GLOBAL VARIABLES ***
Public Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

'*** SOUND VARIABLES ***
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_LOOP = &H8


'*** FORM VARIABLES ***
DICE_SND = GETDIR & "\" & "DICE.WAV"
Call sndPlaySound(ByVal DICE_SND, SND_ASYNC)


I hope this helps!
Brett



Please visit my websites!
 
Thanks Brett but sndPlaySound merely plays a wave file that is on the disk through the output of the sound card. I want to make a sound through the speaker attached to the mother board (one you can hear even if you don't have a sound card)
You can play tones of various frequencies and durations when you click on various command boxes or graphics.
has anyone any info on this?
Quickbasic and Visualbasic version 1 had the commands built in. And if I try to use the API, it says that the DLL called has not got the sound routine in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top