2) Record and Playback using STANDARD Python 2.5.2 and above...
# DEMO code for recording a few seconds of sound and playing back the same
# from inside a terminal running Python 2.x in a Linux distro...
# This assumes /dev/audio exists, if NOT, then install oss-compat
# from your distro`s repository.
# Original idea copyright, (C)2010, B.Walker, G0LCU.
# Issued as Public Domain to LXF.
# You may do as you like with this idea but some acknowledgement
# would be appreciated.
# Save in the Python/Lib drawer(/folder/directory) as arp.py.
# Use "import arp<RETURN/ENTER>" without the quotes to test it.
# Tested on PCLinuxOS 2009, Knoppix 5.1.1, (and Debian 6.0.0 <- WITH
# "oss-compat" installed).
# Ensure the sound system is not already in use.
# (I think this is Python 3.x compatible too.)
# These two imports NOT needed for this quick demo.
# import sys
# import os
# Record from my Laptop`s, Notebook`s and Netbook`s mic.
# Note sample rate unknown at the moment, (8KHz?).
# Shout into the internal mic` for test purposes.
# Playback from the sound card(s).
> I use Python almost totally differently to the vast majority of people. I like "banging the metal".
Well I can assure you that although you might be indeed in a minority,
it is absolutely unlikely you are alone in that.
> As I know of no other way to give my Python code away I thought I`d join here.
I'd would suggest you put it on a free repository like googlecode
(http://code.google.com/) or my personal favourite bit bucket
(https://bitbucket.org/) but there are many other out there too.
Coincidentally both I have mentioned support Mercurial HG, which is
largely written in Python too.
And just post now and again a status update with links to the repository.
Thanks for sharing and happy sharing!
Martin P. Hellwig
On Thu, 24 Feb 2011 19:22:52 +0000, wisecracker wrote:
> As I know of no other way to give my Python code away I thought I`d join
It would be far more appropriate to *ask* where to put your code *first*
rather than to just dump 350+ lines of double-spaced(!) code into
people's inboxes, where it will likely be deleted and rapidly forgotten.
The standard place for putting Python packages and modules is on the
Python Package Index, PyPI: