<commit_before>PySoundCard
===========

PySoundCard is an audio library based on PortAudio, CFFI and NumPy

PySoundCard can play and record audio data. Audio devices are supported
through [PortAudio][], which is a free, cross-platform, open-source audio
I/O library that runs on may platforms including Windows, OS X, and
Unix (OSS/ALSA). It is accessed through [CFFI][], which is a foreign
function interface for Python calling C code. CFFI is supported for
CPython 2.6+, 3.x and PyPy 2.0+. PySoundCard represents audio data as
NumPy arrays.

PySoundCard is inspired by [PyAudio][]. Its main difference is that it uses
CFFI instead of a CPython extension and tries to implement a more
pythonic interface. Its performance characteristics are very similar.

[PortAudio]: http://www.portaudio.com/
[CFFI]: http://cffi.readthedocs.org/
[PyAudio]: http://people.csail.mit.edu/hubert/pyaudio/

PySoundCard is BSD licensed.  
(c) 2013, <NAME>


Installation
-------------

On the Python side, you need to have CFFI and Numpy in order to use
PySoundCard. Additionally, You need the library PortAudio installed on
your computer. On Unix, use your package manager to install PortAudio.
Then just install PySoundCard using pip or `python setup.py install`.

If you are running Windows, I recommend using [WinPython][] or some
similar distribution. This should set you up with Numpy. However, you
also need CFFI and it's dependency, PyCParser. A good place to get
these are the [Unofficial Windows Binaries for Python][pybuilds].
Having installed those, you can download the Windows installers for
PySoundCard:

[PySoundCard-0.4.win-amd64-py2.7](https://github.com/bastibe/PySoundCard/releases/download/0.4.3/PySoundCard-0.4.3.win-amd64-py2.7.exe)  
[PySoundCard-0.4.win-amd64-py3.3](https://github.com/bastibe/PySoundCard/releases/download/0.4.3/PySoundCard-0.4.3.win-amd64-py3.3.exe)  
[PySoundCard-0.4.win32-py2.7](https://github.com/bastibe/PySoundCard/releases/download/0.4.3/PySoundCard-0.4.3.win32-py2.7.exe)  
[PySoundCard-0.4.win32-py3.3](https://github.com/bastibe/PySoundCard/releases/download/0.4.3/PySoundCard-0.4.3.win32-py3.3.exe)

[WinPython]: https://code.google.com/p/winpython/
[pybuilds]: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Usage
-----

The basic building block of audio input/output in PySoundCard are
streams. Streams represent sound cards, both for audio playback and
recording. Every stream has a sample rate, a block size, an input
device and/or an output device.

A stream can be either full duplex (both input and output) or half
duplex (either input or output). This is determined by specifying one
or two devices for the stream. Both devices must be part of the same
audio API.

There are two modes of operation for streams: read/write and callback
mode.

### Read/Write Mode

In read/write mode, two methods are used to play/record audio: For
playback, you `write()` to a stream. For recording, you `read()`
from a stream. You can read/write up to one block of audio data to a
stream without having to wait for it to play.

Here is an example for a program that records a block of audio and
immediately plays it back:<commit_msg>incremented version number<commit_after>PySoundCard
===========

PySoundCard is an audio library based on PortAudio, CFFI and NumPy

PySoundCard can play and record audio data. Audio devices are supported
through [PortAudio][], which is a free, cross-platform, open-source audio
I/O library that runs on may platforms including Windows, OS X, and
Unix (OSS/ALSA). It is accessed through [CFFI][], which is a foreign
function interface for Python calling C code. CFFI is supported for
CPython 2.6+, 3.x and PyPy 2.0+. PySoundCard represents audio data as
NumPy arrays.

PySoundCard is inspired by [PyAudio][]. Its main difference is that it uses
CFFI instead of a CPython extension and tries to implement a more
pythonic interface. Its performance characteristics are very similar.

[PortAudio]: http://www.portaudio.com/
[CFFI]: http://cffi.readthedocs.org/
[PyAudio]: http://people.csail.mit.edu/hubert/pyaudio/

PySoundCard is BSD licensed.  
(c) 2013, <NAME>


Installation
-------------

On the Python side, you need to have CFFI and Numpy in order to use
PySoundCard. Additionally, You need the library PortAudio installed on
your computer. On Unix, use your package manager to install PortAudio.
Then just install PySoundCard using pip or `python setup.py install`.

If you are running Windows, I recommend using [WinPython][] or some
similar distribution. This should set you up with Numpy. However, you
also need CFFI and it's dependency, PyCParser. A good place to get
these are the [Unofficial Windows Binaries for Python][pybuilds].
Having installed those, you can download the Windows installers for
PySoundCard:

[PySoundCard-0.4.4.win-amd64-py2.7](https://github.com/bastibe/PySoundCard/releases/download/0.4.4/PySoundCard-0.4.4.win-amd64-py2.7.exe)  
[PySoundCard-0.4.4.win-amd64-py3.3](https://github.com/bastibe/PySoundCard/releases/download/0.4.4/PySoundCard-0.4.4.win-amd64-py3.3.exe)  
[PySoundCard-0.4.4.win32-py2.7](https://github.com/bastibe/PySoundCard/releases/download/0.4.4/PySoundCard-0.4.4.win32-py2.7.exe)  
[PySoundCard-0.4.4.win32-py3.3](https://github.com/bastibe/PySoundCard/releases/download/0.4.4/PySoundCard-0.4.4.win32-py3.3.exe)

[WinPython]: https://code.google.com/p/winpython/
[pybuilds]: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Usage
-----

The basic building block of audio input/output in PySoundCard are
streams. Streams represent sound cards, both for audio playback and
recording. Every stream has a sample rate, a block size, an input
device and/or an output device.

A stream can be either full duplex (both input and output) or half
duplex (either input or output). This is determined by specifying one
or two devices for the stream. Both devices must be part of the same
audio API.

There are two modes of operation for streams: read/write and callback
mode.

### Read/Write Mode

In read/write mode, two methods are used to play/record audio: For
playback, you `write()` to a stream. For recording, you `read()`
from a stream. You can read/write up to one block of audio data to a
stream without having to wait for it to play.

Here is an example for a program that records a block of audio and
immediately plays it back:
{'fraction_non_alphanumeric': 0.10039463299131808, 'fraction_numerical': 0.02367797947908445, 'mean_word_length': 4.214814814814815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128205', 'n_tokens_mistral': 2061, 'n_tokens_neox': 1963, 'n_words': 773}