#include<stdio.h>
#include<Windows.h>
int main()
{
printf("if you want to stop using morse code, press n\n");
int input;
int dot, dash;
dot = '.', dash = '-';
while (1) {
if (kbhit()) {
input = _getch();
switch (input) {
case 115: Beep(260, 200); printf("%c", dot); break;
case 108: Beep(260, 500); printf("%c", dash); break;
}
if (input == 110) {
break;
}
}
}
return 0;
}
If I type s and n keys sequentially quickly, the sound will delay for 0.1 seconds. How can I make a sound without delay every time I press it?