Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'host,': 0.07; 'permissions': 0.07; 'command.': 0.09; 'modules.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'snippet': 0.09; 'subject:howto': 0.09; 'gui': 0.11; 'suggest': 0.11; 'file,': 0.15; '(just': 0.16; 'alert,': 0.16; 'message- id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'simplest': 0.16; 'subject:simple': 0.16; 'windows': 0.19; 'file.': 0.20; 'trying': 0.21; 'info.': 0.22; 'pipe': 0.22; 'non': 0.24; 'linux': 0.24; 'command': 0.24; 'tried': 0.25; 'header:User-Agent:1': 0.26; 'creating': 0.26; 'raw': 0.27; 'header:X-Complaints-To:1': 0.28; 'character': 0.29; 'push': 0.30; 'code': 0.31; 'running': 0.32; 'certain': 0.33; 'ubuntu': 0.33; 'handle': 0.33; 'to:addr:python- list': 0.33; 'hi,': 0.33; 'another': 0.33; 'thanks': 0.34; 'list': 0.35; 'received:org': 0.36; 'but': 0.36; 'moment': 0.37; 'data': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'within': 0.64; 'subject: ': 0.66; 'wave': 0.71; 'bel': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Gelonida N Subject: howto do a robust simple cross platform beep Date: Sat, 14 Jul 2012 03:00:05 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: unicorn.dungeon.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342227619 news.xs4all.nl 6919 [2001:888:2000:d::a6]:53801 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25299 Hi, I just want to use a beep command that works cross platform. I tried the simplest approach (just printing the BEL character '\a' chr(7) to the console. This fails on my Ubuntu 12.04 host, as the pcspkr is in the list of the blacklisted kernel modules. I found another snippet trying to push a sine wave directly to /dev/audio but I don't have write permissions to /dev/audio. Other solutions seem to suggest to play a wav file, but of course first I had to write code creating me a wav file. How do others handle simple beeps? I just want to use them as alert, when certain events occur within a very long running non GUI application. Thanks for any info. What I do at the moment is: For Windows I use winsound.Beep For Linux I create some raw data and pipe it into sox's 'play' command. I don't consider this very elegant.