/usr/lib/python2.7/dist-packages/SoundFile-0.8.1.egg-info/PKG-INFO is in python-soundfile 0.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | Metadata-Version: 1.1
Name: SoundFile
Version: 0.8.1
Summary: An audio library based on libsndfile, CFFI and NumPy
Home-page: https://github.com/bastibe/PySoundFile
Author: Bastian Bechtold
Author-email: basti@bastibe.de
License: BSD 3-Clause License
Description: PySoundFile
===========
`PySoundFile <https://github.com/bastibe/PySoundFile>`__ is an audio
library based on libsndfile, CFFI and NumPy. Full documentation is
available on http://pysoundfile.readthedocs.org/.
PySoundFile can read and write sound files. File reading/writing is
supported through `libsndfile <http://www.mega-nerd.com/libsndfile/>`__,
which is a free, cross-platform, open-source (LGPL) library for reading
and writing many different sampled sound file formats that runs on many
platforms including Windows, OS X, and Unix. It is accessed through
`CFFI <http://cffi.readthedocs.org/>`__, which is a foreign function
interface for Python calling C code. CFFI is supported for CPython 2.6+,
3.x and PyPy 2.0+. PySoundFile represents audio data as NumPy arrays.
| PySoundFile is BSD licensed (BSD 3-Clause License).
| (c) 2013, Bastian Bechtold
Breaking Changes
----------------
PySoundFile has evolved rapidly during the last few releases. Most
notably, we changed the import name from ``import pysoundfile`` to
``import soundfile`` in 0.7. In 0.6, we cleaned up many small
inconsistencies, particularly in the the ordering and naming of
function arguments and the removal of the indexing interface.
In 0.8.0, we changed the default value of ``always_2d`` from ``True``
to ``False``. Also, the order of arguments of the ``write`` function
changed from ``write(data, file, ...)`` to ``write(file, data, ...)``.
Installation
------------
PySoundFile depends on the Python packages CFFI and NumPy, and the
system library libsndfile.
To install the Python dependencies, I recommend using the `Anaconda
<http://continuum.io/downloads>`__ distribution of Python 3. This will
come with all dependencies pre-installed. To install the dependencies
manually, you can use the ``conda`` package manager, which will
install all dependencies using ``conda install cffi numpy`` (conda is
also available independently of Anaconda with ``pip install conda;
conda init``).
With CFFI and NumPy installed, you can use ``pip install pysoundfile``
to download and install the latest release of PySoundFile. On Windows
and OS X, this will also install the library libsndfile. On Linux, you
need to install libsndfile using your distribution's package manager,
for example ``sudo apt-get install libsndfile1``.
Read/Write Functions
--------------------
Data can be written to the file using `soundfile.write()`, or read from
the file using `soundfile.read()`. PySoundFile can open all file formats
that `libsndfile supports
<http://www.mega-nerd.com/libsndfile/#Features>`__, for example WAV,
FLAC, OGG and MAT files.
Here is an example for a program that reads a wave file and copies it
into an ogg-vorbis file:
.. code:: python
import soundfile as sf
data, samplerate = sf.read('existing_file.wav')
sf.write('new_file.ogg', data, samplerate)
Block Processing
----------------
Sound files can also be read in short, optionally overlapping blocks
with `soundfile.blocks()`.
For example, this calculates the signal level for each block of a long
file:
.. code:: python
import numpy as np
import soundfile as sf
rms = [np.sqrt(np.mean(block**2)) for block in
sf.blocks('myfile.wav', blocksize=1024, overlap=512)]
SoundFile Objects
-----------------
Sound files can also be opened as `soundfile.SoundFile` objects. Every
SoundFile has a specific sample rate, data format and a set number of
channels.
If a file is opened, it is kept open for as long as the SoundFile
object exists. The file closes when the object is garbage collected,
but you should use the `soundfile.SoundFile.close()` method or the
context manager to close the file explicitly:
.. code:: python
import soundfile as sf
with sf.SoundFile('myfile.wav', 'rw') as f:
while f.tell() < len(f):
pos = f.tell()
data = f.read(1024)
f.seek(pos)
f.write(data*2)
All data access uses frames as index. A frame is one discrete time-step
in the sound file. Every frame contains as many samples as there are
channels in the file.
RAW Files
---------
Pysoundfile can usually auto-detect the file type of sound files. This
is not possible for RAW files, though:
.. code:: python
import soundfile as sf
data, samplerate = sf.read('myfile.raw', channels=1, samplerate=44100,
subtype='FLOAT')
Note that on x86, this defaults to ``endian='LITTLE'``. If you are
reading big endian data (mostly old PowerPC/6800-based files), you
have to set ``endian='BIG'`` accordingly.
You can write RAW files in a similar way, but be advised that in most
cases, a more expressive format is better and should be used instead.
Virtual IO
----------
If you have an open file-like object, Pysoundfile can open it just like
regular files:
.. code:: python
import soundfile as sf
with open('filename.flac', 'rb') as f:
data, samplerate = sf.read(f)
Here is an example using an HTTP request:
.. code:: python
import io
import soundfile as sf
from urllib.request import urlopen
url = "http://tinyurl.com/shepard-risset"
data, samplerate = sf.read(io.BytesIO(urlopen(url).read()))
Note that the above example only works with Python 3.x.
For Python 2.x support, replace the third line with:
.. code:: python
from urllib2 import urlopen
News
----
2013-08-27 V0.1.0 Bastian Bechtold:
Initial prototype. A simple wrapper for libsndfile in Python
2013-08-30 V0.2.0 Bastian Bechtold:
Bugfixes and more consistency with PySoundCard
2013-08-30 V0.2.1 Bastian Bechtold:
Bugfixes
2013-09-27 V0.3.0 Bastian Bechtold:
Added binary installer for Windows, and context manager
2013-11-06 V0.3.1 Bastian Bechtold:
Switched from distutils to setuptools for easier installation
2013-11-29 V0.4.0 Bastian Bechtold:
Thanks to David Blewett, now with Virtual IO!
2013-12-08 V0.4.1 Bastian Bechtold:
Thanks to Xidorn Quan, FLAC files are not float32 any more.
2014-02-26 V0.5.0 Bastian Bechtold:
Thanks to Matthias Geier, improved seeking and a flush() method.
2015-01-19 V0.6.0 Bastian Bechtold:
A big, big thank you to Matthias Geier, who did most of the work!
- Switched to ``float64`` as default data type.
- Function arguments changed for consistency.
- Added unit tests.
- Added global ``read()``, ``write()``, ``blocks()`` convenience
functions.
- Documentation overhaul and hosting on readthedocs.
- Added ``'x'`` open mode.
- Added ``tell()`` method.
- Added ``__repr__()`` method.
2015-04-12 V0.7.0 Bastian Bechtold:
Again, thanks to Matthias Geier for all of his hard work, but also
Nils Werner and Whistler7 for their many suggestions and help.
- Renamed ``import pysoundfile`` to ``import soundfile``.
- Installation through pip wheels that contain the necessary
libraries for OS X and Windows.
- Removed ``exclusive_creation`` argument to ``write``.
- Added ``truncate()`` method.
2015-10-20 V0.8.0 Bastian Bechtold:
Again, Matthias Geier contributed a whole lot of hard work to this
release.
- Changed the default value of ``always_2d`` from ``True`` to
``False``.
- Numpy is now optional, and only loaded for ``read`` and
``write``.
- Added ``SoundFile.buffer_read`` and
``SoundFile.buffer_read_into`` and ``SoundFile.buffer_write``,
which read/write raw data without involving Numpy.
- Added ``info`` function that returns metadata of a sound file.
- Changed the argument order of the ``write`` function from
``write(data, file, ...)`` to ``write(file, data, ...)``
And many more minor bug fixes.
Keywords: audio,libsndfile
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Multimedia :: Sound/Audio
|