From c0ce3c24c42543034a7aa7ca7cbe204ce67868dc Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 24 Jan 2005 15:54:00 +0000 Subject: [PATCH] Implement runtime control of error frequency and volume. --- morse.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/morse.c b/morse.c index 32c3d08..122dde7 100644 --- a/morse.c +++ b/morse.c @@ -1665,17 +1665,14 @@ int resync; * Scold them for their mistake. */ printf ("\n"); -#ifdef ERROR_VOLUME -#ifndef ERROR_FREQ -#define ERROR_FREQ 2000. -#endif - /* Beep using the tone generator */ - toneflush (); - tone ((float) (ERROR_FREQ), .1, (float) (ERROR_VOLUME)); -#else - /* Beep using control-G */ - printf ("\007"); -#endif + + if (error_volume) { + /* Beep using the tone generator */ + toneflush (); + tone (error_frequency, 0.1, error_volume); + } else + /* Beep using control-G */ + printf ("\007"); printf ("%c (%s) for %c (%s)\n", yourchar, code[yourcharnocase], correctchar, code[correctchar]); -- 2.43.0