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!

SoundCard vs PC speaker 1

Status
Not open for further replies.

JimmyK

Programmer
Sep 8, 2000
142
VN
Hi all,
My PC has a soundcard onboard but i want to play a BEEP sound to PC speaker, not soundcard
How can i do that?

Thanks a lot

Jimmy
 
Every since the release of of Windows 95 and VisualFoxPro, direct access to the PC Speaker is no longer supported. You will have to use wave files or C++ programming.

David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
try ?? CHR(7)
it will either beep or at least click the speaker.
 
Hi Jimmy,

If your intention is to play a bell sound which appears not to work with the default specker... then you can solve it by the following command.

Issue the following command....
SET BELL ON
** SET BELL TO "mypath\mySound.WAV"
SET BELL TO "C:\WINDOWS\MEDIA\DING.WAV"
? CHR(7)

Hope this helps you :)


ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thank my brothers,
But what i want is BEEP BEEP by PC internal speaker, not played by soundcard

i have solved the problem by writting DLL in C++.

Thanks


Jimmy Le
nhan_tiags@yahoo.com
 
Declare long Beep IN WIN32API long dwFreq, long dwDuration
=Beep(1500,100)
=Beep(1500,1000)
=Beep(3000,100)

Where:
· dwFreq
Windows NT:
Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
Windows 95:
The parameter is ignored.

· dwDuration
Windows NT:
Specifies the duration, in milliseconds, of the sound.
Windows 95:
The parameter is ignored.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top