Sfor Posted June 23, 2009 Posted June 23, 2009 I've been trying to make a beep by using batch file in a DOS window of 95/98 system. All I could get was a very short sound same as the Windows error condition sound.Without GUI everything is working as it should to, but in DOS window the PC Speaker sounds are less than audible.
Sfor Posted June 23, 2009 Author Posted June 23, 2009 It says the application performed an illegal operation (or something like that, since I'm working with a polish version of Windows 98).
uid0 Posted June 23, 2009 Posted June 23, 2009 echo ctrl-G gives an ascii bell - makes a beep in xp but sounds like ding.wav on 98.
Sfor Posted June 23, 2009 Author Posted June 23, 2009 (edited) I wouldn't say it is a ding.wav like sound. It's rather the sound generated when a wrong key is pressed. It's more a tick than a soud. So, it's hardly audible and hardly useful. Edited June 23, 2009 by Sfor
Mijzelf Posted June 23, 2009 Posted June 23, 2009 (edited) Second try:<br /><br />rundll32 shell32.dll,Control_RunDLL user32.dll,MessageBeep,-1<br /><br />Instead of -1 you can also try 0, 16, 32, 48, 64Edit:Ehm, sorry, this doesn't work. Edited June 23, 2009 by Mijzelf
Mijzelf Posted June 23, 2009 Posted June 23, 2009 Are you helped by a small executable?#include <dos.h>#include <stdlib.h>#include <stdio.h>int main( int argc, char **argv ){ if( argc != 3 ) { printf( "use beep frequency (Hz) duration (sec)\n" ); return 0; } sound( atoi( argv[ 1 ] ) ); sleep( atoi( argv[ 2 ] ) ); nosound(); return 0; }Compiled version here
Sfor Posted June 24, 2009 Author Posted June 24, 2009 Well. The program works. But, a batch made that way is hardly a portable one.Also, I made my own program in Borland Pascal. The resulting EXE file is just a half size of a COM made by C compler.Program Beep; uses CRT; var Tone,Duration: Word; Check: Integer;begin if ParamCount<=2 then begin Writeln; Writeln ('BEEP Frequency Duration'); Writeln; Writeln (' Frequency - Hz'); Writeln (' Duration - mS'); Writeln; Tone:=800; Duration:=1000; end else begin VAL (ParamStr(1),Tone,Check); VAL (ParamStr(2),Duration,Check); end; Sound (Tone); Delay (Duration); NoSound;end.
Glenn9999 Posted June 24, 2009 Posted June 24, 2009 Certain things in 95/98 are backward when it comes to the API, so you have to code for them in assembler instead to get the functionality (which is a pain to be truthful). The program solution is the only valid one for 95/98 for this reason (the HLLs posted have this functionality).
Drugwash Posted June 28, 2009 Posted June 28, 2009 Try AutoHotkey -> SoundBeep [, Frequency, Duration]Actually, AHK can do a lot of marvellous things. I'm playing with it a lot.
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