Top-rated recipes tagged "beep"http://code.activestate.com/recipes/tags/beep/top/2014-11-23T19:24:46-08:00ActiveState Code RecipesA Function To Create A 1 Second Sinewave WAVE Beep File. (Python) 2014-11-23T19:24:46-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578971-a-function-to-create-a-1-second-sinewave-wave-beep/ <p style="color: grey"> Python recipe 578971 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/error_beep/">error_beep</a>, <a href="/recipes/tags/error_sound/">error_sound</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sinewave/">sinewave</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/wav/">wav</a>, <a href="/recipes/tags/wave/">wave</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>sinebeep.py</p> <p>Creating an audio file called...</p> <p>beep.wav</p> <p>...that can be played using almost ANY audio player available.</p> <p>This simple snippet of code generates a 1 second sinewave WAVE file. It IS saved inside the CURRENT drawer so that you can find it... ;o)</p> <p>This works on:- Classic stock AMIGA A1200, using Python 1.4.0. WinUAE and E-UAE, AmigaOS 3.0.x using Python 1.4.0 to 2.0.1. Windows, to at least 7, using Python 2.0.1 to 3.3.2. Various Linux flavours using Python 2.4.6 to 3.2.2. Apple OSX 10.7.x and above using Python 2.5.6 to 3.4.1.</p> <p>The file size is 8044 bytes and _IF_ you need to it can be palyed directly without a player on some Linux flavours that have the /dev/dsp device. It is an 8 bit, unsigned integer, mono, 8000Hz sampling speed 8000 byte RAW file with the WAVE header added.</p> <p>It will still work with PulseAudio and OSS using...</p> <p>cat /full/path/to/beep.wav &gt; /dev/dsp</p> <p>...but with a momenatry click due to the 44 header bytes; but hey it is a beep alternative...</p> <p>Enjoy finding simple solutions to often very difficult problems.</p> <p>Bazza.</p> beep based alarm - command line utility (Python) 2014-10-25T22:29:10-07:00Tomas Nordinhttp://code.activestate.com/recipes/users/4189558/http://code.activestate.com/recipes/578953-beep-based-alarm-command-line-utility/ <p style="color: grey"> Python recipe 578953 by <a href="/recipes/users/4189558/">Tomas Nordin</a> (<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/argparse/">argparse</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/commandline/">commandline</a>). Revision 2. </p> <p>An alarm beeping on you when the eggs are boiled.</p> A Bash Beep Command For OSX 10.7+... (Bash) 2014-02-27T19:36:17-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578837-a-bash-beep-command-for-osx-107/ <p style="color: grey"> Bash recipe 578837 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/error_beep/">error_beep</a>, <a href="/recipes/tags/error_sound/">error_sound</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>This small bash script generates an 8044 byte 1KHz sinewave wave file and immediately plays it. The file created is a _pure_ sinewave and lasts for 1 second. It uses the default "afplay" command to run the generated file.</p> <p>It was designed around an Apple Macbook Pro but using "aplay" it might even work on other *nix flavours from the command line. I have not bothered to try it as this was purely for my MB Pro.</p> <p>The wave file can be found as "/tmp/sinewave.wav" during the working session(s) and can be saved anywhere of your choice.</p> <p>Enjoy...</p> <p>(Watch for word wrapping etc...)</p> <p>Bazza.</p> music module (Python) 2013-08-02T02:37:01-07:00Andrew Wayne Teesdale Jr.http://code.activestate.com/recipes/users/4187305/http://code.activestate.com/recipes/578620-music-module/ <p style="color: grey"> Python recipe 578620 by <a href="/recipes/users/4187305/">Andrew Wayne Teesdale Jr.</a> (<a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/music/">music</a>). </p> <p>a module for musical beeps</p> A DEMO 6 Bit At A Glance Colouerd Bargraph Generator. (Bash) 2013-01-16T12:26:55-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578391-a-demo-6-bit-at-a-glance-colouerd-bargraph-generat/ <p style="color: grey"> Bash recipe 578391 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>). Revision 2. </p> <p>This code generates a horizontal coloured real time bargraph generator anim for a Macbook Pro 13 inch, OSX 10.7.5, using the default standard Terminal only.</p> <p>It is UNTESTED on Linux variants but I would like any successful Linux tryers to make a comment in the comments section and tags will be added accordingly otherwise I will assume it does NOT work on other UNIX like variants.</p> <p>It is a derivative of my 7 bit bargraph generator for Python on this site elsewhere.</p> <p>The Terminal colours WILL be changed on running but it is simple to return it back to its original state.</p> <p>Read the code for more information.</p> <p>Enjoy, (and a Happy New Year)...</p> <p>Bazza, G0LCU...</p> Clear screen and beep for various platforms. (Python) 2011-02-26T14:26:02-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577588-clear-screen-and-beep-for-various-platforms/ <p style="color: grey"> Python recipe 577588 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/clearscreen/">clearscreen</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/error_beep/">error_beep</a>, <a href="/recipes/tags/error_sound/">error_sound</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/screenclear/">screenclear</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>This little module gives a clear screen and beep for the classic AMIGA, WinUAE, Windows and Linux all in CLI/Command-Prompt/Terminal mode.</p> <p>It works from Python 1.4.x to 2.7.x; talk about backwards compatibility... ;oD With very little modification it will work on Python 3.x.x easily.)</p> <p>See the file clsbeep.py attached for more information.</p> <p>it is saved as clsbeep.py and placed into the Python - Lib drawer or where-ever the modules are located and called as a module:-</p> <pre class="prettyprint"><code>&gt;&gt;&gt; import clsbeep </code></pre> <p>Its usage is:-</p> <p>clsbeep.cls() and clears the screen. clsbeep.beep() and creates an error beep. clsbeep.both() creates an error beep first then clears the screen.</p> <p>It is Public Domain and if you modify it to suit other platforms please let me have a copy of your code... :)</p> <p>Enjoy finding simple solutions to often very difficult problems. ;o)</p>