
Floating point audio data is typically in the range from ``-1.0`` to ``1.0``. """ _version_ = "0.10.3" import os as _os import sys as _sys from os import SEEK_SET, SEEK_CUR, SEEK_END from ctypes.util import find_library as _find_library from _soundfile import ffi as _ffi try : _unicode = unicode # doesn't exist in Python 3.x except NameError : _unicode = str _str_types =, optional Data type of the returned array, by default ``'float64'``. Alternatively, sound files can be opened as :class:`SoundFile` objects. To read a sound file in a block-wise fashion, use :func:`blocks`. Sound files can be read or written directly using the functions :func:`read` and :func:`write`. The PyHVDI is prepared for: Linux and MS Windows for now, and is tested on the following platforms: Ubuntu 14."""SoundFile is an audio library based on libsndfile, CFFI and NumPy. > HawkVoiceDI has been tested on the following platforms: Win32 (9x, ME, NT 4.0, 2000, XP, CE) > outwf = wave.open(“output-file.wav”, “w”) > # I already told you that it is simple. > # Encode it to GSM and decode from it to hear how it sounds: > # But now, let us reencode the input file. > # Ow, we probably could have skipped boring stuff above and assume the wave file is of the right format! > # Exercise gain control, just for fun of it: > samples = m.resample(samples, inwf.getframerate(), 8000) > right = m.resample(right, inwf.getframerate(), 8000) > left = m.resample(left, inwf.getframerate(), 8000) > # If file is stereo, turn it to mono by mixing left and right channel together: > samples = inwf.readframes(inwf.getnframes())

> inwf = wave.open(“input-file.wav”, “r”) Of a stereo input to be used separately and some more useful stuff. It also allows you to mix audio chunks together, perform audio gain control on them, uninterleave left and right channels The library provides you with the Mixer() class that can be used to downsample the data if necessary. The minimal length of the input audio chunk that is required depends on the used codec.

Input data are strings of 8000 Hz sample rate, 16bit, mono, linear PCM audio bytes. The decoder accepts the packets and even keeps track of correct sequence order for you.

The encoder returns packets ready for UDP transmission (encryption and signing included). The library supports the following compressed audio codecs: LPC, Some, more Pythonic, higher level, classes and functions to make audio encoding/decoding as easy as possible. This package allows you to access the low-level functions of HawkVoiceDI and implements Python bindings (by Dalen Bernaca) for HawkVoice Direct Interface (HVDI) - cross platform network voice library by Phil Frisbie.
