|
1 | 1 | python-wavefile |
2 | 2 | =============== |
3 | 3 |
|
4 | | -'wavefile' python module to read and write audio files. |
5 | | -It is a pythonic wrapper to the sndfile library featuring: |
6 | | -* Attribute access to format, channels, length, sample rate... |
7 | | -* Numpy interface using in place arrays (optimal for block processing) |
8 | | -* Works as context manager |
9 | | -* Different objects for reading and writing (no modes, consistent interface) |
10 | | -* Shortened constants accessing for formats and the like |
11 | | -* Matlab like whole file interface (not recommended but convenient) |
| 4 | +Pythonic libsndfile wrapper to read and write audio files. |
| 5 | + |
| 6 | +Features: |
| 7 | + |
| 8 | +* Attribute access for format, channels, length, sample rate... |
| 9 | +* Numpy interface using in-place arrays (optimal for block processing) |
| 10 | +* Real multichannel (not just mono/stereo) |
| 11 | +* Separate classes for reading and writing, so that available operations are consistent with the mode. |
| 12 | +* Writer and reader objects work as context managers for [RAII idiom](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) |
| 13 | +* Shortened constant names for formats (Using scopes instead of prefixes) |
| 14 | +* Matlab like whole-file interface (not recommended in production code but quite convenient for quick scripting) |
| 15 | +* No module compilation required (wraps the dll using ctypes) |
| 16 | +* Works both for Python3 >= 3.3 and Python2 >= 2.6 |
12 | 17 |
|
13 | 18 | You can find the latest version at: |
14 | 19 | https://github.com/vokimon/python-wavefile |
15 | 20 |
|
16 | 21 | TODO: |
| 22 | + |
17 | 23 | * Handling properly different physical numpy layouts: use a view, assert or reshape |
18 | | -* sndfile command interface |
| 24 | +* Exposing sndfile command API |
19 | 25 | * Seeking |
20 | 26 | * Use file name extension to deduce main format, if not specified |
21 | | -* Use main format to deduce subformat if not specified |
22 | | -* Providing strings for formats |
| 27 | +* Use main format to deduce subformat, if not specified |
| 28 | +* Separate Formats scope into Formats, Subformats and Endianess |
| 29 | +* Expose descriptive strings for formats |
| 30 | +* Handling properly unicode in text strings (now considers them UTF-8, which is not always true) |
23 | 31 |
|
24 | 32 | Installation |
25 | 33 | ------------ |
26 | 34 |
|
| 35 | +### Using PyPi |
| 36 | + |
| 37 | +```bash |
| 38 | +pypi-install wavefile |
| 39 | +``` |
| 40 | + |
| 41 | +### From sources |
| 42 | + |
27 | 43 | A setup.py script is provided so the common procedure for |
28 | 44 | installing python packages in you platfrom will work. |
29 | 45 | For example in Debian/Ubuntu systems: |
@@ -185,13 +201,30 @@ So this is a summary of what I found, just in case it is useful to anyone. |
185 | 201 |
|
186 | 202 | - libsndfilectypes |
187 | 203 | - http://code.google.com/p/pyzic/wiki/LibSndFilectypes |
188 | | - - ctypes based wrapper |
189 | | - - No compilation required |
| 204 | + - ctypes based wrapper: no compilation required |
190 | 205 | - numpy supported |
191 | 206 | - Windows only setup (fixable) |
192 | 207 | - Long access to constants |
193 | 208 | - Not inplace read (creates an array every time) |
194 | 209 |
|
195 | 210 |
|
| 211 | +python-wavefile reuses most of the libsndfilectypes ctypes wrapper, |
| 212 | +as not requiring module compilation was seen as a good point. |
| 213 | +A pythonic layer was added on the top of it. |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | +Version history |
| 218 | +--------------- |
| 219 | + |
| 220 | +### 1.1 |
| 221 | + |
| 222 | +- Python 3 support |
| 223 | +- Support for unicode filenames |
| 224 | + |
| 225 | +### 1.0 |
| 226 | + |
| 227 | +- First version |
| 228 | + |
196 | 229 |
|
197 | 230 |
|
0 commit comments