From owner-freebsd-questions@FreeBSD.ORG Fri Aug 12 23:02:26 2011 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 41D8D1065673 for ; Fri, 12 Aug 2011 23:02:26 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5758FC19 for ; Fri, 12 Aug 2011 23:02:25 +0000 (UTC) Received: by thought.org (Postfix, from userid 1001) id 1DD89E80F56; Fri, 12 Aug 2011 23:02:24 +0000 (UTC) Date: Fri, 12 Aug 2011 16:02:24 -0700 From: Gary Kline To: Polytropon Message-ID: <20110812230224.GA9253@thought.org> References: <20110812192745.GA15543@thought.org> <20110812213921.6cfdfa89.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110812213921.6cfdfa89.freebsd@edvax.de> Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 25 years of service to the Unix community. User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-questions@freebsd.org Subject: Re: library with click built-in? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 23:02:26 -0000 On Fri, Aug 12, 2011 at 09:39:21PM +0200, Polytropon wrote: > Date: Fri, 12 Aug 2011 21:39:21 +0200 > From: Polytropon > Subject: Re: library with click built-in? > To: Gary Kline > Cc: freebsd-questions@freebsd.org > X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; amd64-portbld-freebsd8.2) > > On Fri, 12 Aug 2011 12:27:48 -0700, Gary Kline wrote: > > I only use my FreeBSD computer as a server; it isn't even hooked > > up to my speakers, so there is no way of testing anything i write > > that involves sound. So.... does anybody know if any other toolkit > > outputs audio? > > There are two means: > > The first one is the echoing of the ^G (BEL) character, 0x07 > which is handled by the text mode console or terminal emulators > like xterm. In X, the sound that will be produced can be > controlled with a xset setting. > > xset [-b] [b {on|off}] [b [volume [pitch [duration]]]] > > See "man xset" for details. > > > The other one is the system speaker. If you have "device speaker" > in your kernel, you can access /dev/speaker (if the permissions > are set properly, see /etc/devfs.conf for an example. Using > the "note language" known from several BASIC dialects for > microcomputers, you can easily create sounds for that. A list > of the "note language" is in "man 4 speaker". > > Here's a small example: > > #!/bin/sh > read -p "CW ===> " TEXT > echo ${TEXT} | morse | awk '{ > if(length($0) == 0) > printf("P4\n"); > else { > gsub(" dit", "P32L32E", $0); > gsub(" di", "P32L32E", $0); > gsub(" dah", "P32L8E", $0); > printf("%sP16\n", $0); > } > }' | dd bs=256 of=/dev/speaker > /dev/null 2>&1 > > NB: The timing is slightly out of proper relation. :-) > > > thanks. i have _never_ heard the BEL inmy version of ubuntu. my server is a 2-proc dell, too cheap to have a real spkr; it does beep [bbarely] thanks to some kind of piezo gimmick. but no speaker connections. i'll check around on my homebrew desktop... > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 8.51a release of Jottings: http://jottings.thought.org