Popular recipes tagged "wav"http://code.activestate.com/recipes/tags/wav/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> Wav audio file dynamic range compressor (C) 2013-04-18T15:04:25-07:00Granning Stolinehttp://code.activestate.com/recipes/users/4186069/http://code.activestate.com/recipes/578510-wav-audio-file-dynamic-range-compressor/ <p style="color: grey"> C recipe 578510 by <a href="/recipes/users/4186069/">Granning Stoline</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/compressor/">compressor</a>, <a href="/recipes/tags/dynamic/">dynamic</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/range/">range</a>, <a href="/recipes/tags/wav/">wav</a>). Revision 4. </p> <p>Wav audio file dynamic range compressor</p>