TurionAltec Posted February 14, 2008 Posted February 14, 2008 In XP/2000, when the beep function is called it will send a tone to the PC Speaker. For example beep(500,1000) Will sound the PC Speaker at 500Hz for 1000ms. In Windows9x if a soundcard is present Windows will intercept the call to the PC speaker and instead play the "default" WAV file through the sound card. This is a limitation of the Windows API, and not AutoIT, as other programs (like nircmd) will do the same thing if you try to beep the speaker. Is there any other way to send audio directly to the PC speaker? Ideally I want to be able to beep different frequencies and lengths, but even a standard "Bell" beep would help. I can't disable the Soundcard because I want it available when the user plugs in headphones. I know that there's a PCSpeaker audio driver that lets the PC speaker act as a Wave device but as I recall the sound quality was extremely poor, and I don't want to lose the soundcard as the default device. Currently I'm trying a hideous Hack using Qbasic. I make a file like sound.BAS: sound 500,6 sound 1000,6 sound 1500,6 sleep 2 system Then call it from autoit run("c:\qbasic\qbasic.exe /run sound.bas") In the screen properties for the command prompt , disabling "FAST ROM Emulation" will cause Windows to pass PC speaker calls to the speaker. Unfortunately the performance doing this is shady and it won't always properly play the sounds eg: timings are way off and a tone might stick on. As well the creation of the command window might frig up the program, especially if it runs in full-screen. I also get poor performance if I try a simple BATCH file with "Echo ^G" in it. Any ideas on playing to the PC speaker in Windows98?
rover Posted February 14, 2008 Posted February 14, 2008 I don't have Win98 to try this on but this will send the 'Bel' character and beep the PC speaker (back to the days of teletype terminals) Run(@ComSpec & " /c " & Chr(7), "", @SW_HIDE) I see fascists...
herewasplato Posted February 14, 2008 Posted February 14, 2008 AutoIt "Beeps" and that cmd "Chr(7)" bell are most annoying.I forgot how loud the "PC speaker" beep is on this laptop.Anyway, the "Chr(7)" method did not work for me using W98SE via MS Virtual PC 2007. AutoIt "Beeps" come out as the OP stated in that VPC and the "Chr(7)" method did nothing. [size="1"][font="Arial"].[u].[/u][/font][/size]
rover Posted February 14, 2008 Posted February 14, 2008 (edited) AutoIt "Beeps" and that cmd "Chr(7)" bell are most annoying.very annoyingI use Beep(1000,5) for more of a click or 'pip' soundas an augment to consolewrite or traytip when waiting for single events to occur when debuggingAnyway, the "Chr(7)" method did not work for me using W98SE via MS Virtual PC 2007. AutoIt "Beeps" come out as the OP stated in that VPC and the "Chr(7)" method did nothing.looks like it's not doableand those old beep.com dos filesare the same thing as that basic code the OP's runningthe whole video bios issue at bottom of this MS knowledgbase article MS-DOS-Based Programs Do Not Play Beeps Through PC Speakermany posts on Usenet (Newsgroups)pc speaker beep win98Can't hear internal speaker beep in Win98 Edited February 14, 2008 by rover I see fascists...
rudi Posted February 15, 2008 Posted February 15, 2008 Hi. I don't have Win98 to try this on but this will send the 'Bel' character and beep the PC speaker (back to the days of teletype terminals) Run(@ComSpec & " /c " & Chr(7), "", @SW_HIDE)oÝ÷ Ûú®¢×+0Ym¯+hmì^rë^ý°D¿méejÆ¢iÚ+¦º ©¢ì"YÞyÛh!Îmée¶(ºwmë)y©®Æ®¶se'Vâ6öÕ7V2fײgV÷C²ö2V6ògV÷C²fײ6"rÂgV÷C²gV÷C²Â5uôDR IIRC this will send the sound to the default sound device. So if your Win98 has a soundcard + speakers, it will not be send to the PC internal speaker (which cannot be switched off) Regards, Rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now