Popular recipes tagged "wave"http://code.activestate.com/recipes/tags/wave/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 > /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>
Play wave audio (Python)
2009-08-04T05:45:46-07:00giuseppelobruttohttp://code.activestate.com/recipes/users/4171336/http://code.activestate.com/recipes/576866-play-wave-audio/
<p style="color: grey">
Python
recipe 576866
by <a href="/recipes/users/4171336/">giuseppelobrutto</a>
(<a href="/recipes/tags/multimedia/">multimedia</a>, <a href="/recipes/tags/ossaudiodev/">ossaudiodev</a>, <a href="/recipes/tags/wave/">wave</a>).
</p>
<p>Play wave audio</p>