From owner-freebsd-questions@FreeBSD.ORG Fri Dec 25 19:49:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2FED106568B for ; Fri, 25 Dec 2009 19:49:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 922BF8FC13 for ; Fri, 25 Dec 2009 19:49:16 +0000 (UTC) Received: from r55.edvax.de (port-92-195-26-31.dynamic.qsc.de [92.195.26.31]) by mx02.qsc.de (Postfix) with ESMTP id A65861E578; Fri, 25 Dec 2009 20:49:15 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id nBPJnEgH003100; Fri, 25 Dec 2009 20:49:15 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Fri, 25 Dec 2009 20:49:14 +0100 From: Polytropon To: Anton Shterenlikht Message-Id: <20091225204914.2a532df3.freebsd@edvax.de> In-Reply-To: <20091225185826.GA82073@mech-cluster241.men.bris.ac.uk> References: <20091225185826.GA82073@mech-cluster241.men.bris.ac.uk> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: example c program that does "beep" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 19:49:16 -0000 On Fri, 25 Dec 2009 18:58:26 +0000, Anton Shterenlikht wrote: > How can I get a beep from c? > I looked at curses and syscons.c, but > still not clear. If you want to use NCURSES / CURSES, it's a bit complicated. Otherwise, just output %c (the character) 0x07, BEL, which generates an audible bell, or beep. *** text/plain attachement has been stripped *** RETRY *** /* beepflash.c * ----------- * cc -Wall -lcurses -o beepflash beepflash.c * */ #include #include int main(int argc, char *argv[]) { initscr(); cbreak(); noecho(); nonl(); intrflush(stdscr, FALSE); keypad(stdscr, TRUE); start_color(); printf("beep: %d\n", beep()); fflush(stdout); printf("flash: %d\n", flash()); fflush(stdout); return 0; } -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...