June 23, 200917 yr 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.
June 23, 200917 yr Author It says the application performed an illegal operation (or something like that, since I'm working with a polish version of Windows 98).
June 23, 200917 yr echo ctrl-G gives an ascii bell - makes a beep in xp but sounds like ding.wav on 98.
June 23, 200917 yr Author 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, 200917 yr by Sfor
June 23, 200917 yr 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, 200917 yr by Mijzelf
June 23, 200917 yr 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
June 24, 200917 yr Author 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.
June 24, 200917 yr 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).
June 28, 200917 yr Try AutoHotkey -> SoundBeep [, Frequency, Duration]Actually, AHK can do a lot of marvellous things. I'm playing with it a lot.
Create an account or sign in to comment