• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H03-May-2022-652384

pysndfile/H20-Jan-2020-264166

tests/H03-May-2022-123100

ChangeLogH A D26-Jun-20194.8 KiB144110

LONG_DESCRH A D20-Jan-202012.1 KiB365271

PKG-INFOH A D20-Jan-202015.7 KiB385290

README.mdH A D20-Jan-202011.3 KiB267176

README.md.cksumH A D20-Jan-202071 21

_pysndfile.pyxH A D19-Jan-202049.1 KiB1,2621,011

pyproject.tomlH A D04-Aug-2019168 43

pysndfile.hhH A D20-Jan-202024.2 KiB712484

setup.cfgH A D26-Jun-2019350 1110

setup.pyH A D01-Aug-20199.7 KiB261188

sndfile_linux.pxiH A D21-Jul-20191.2 KiB2826

sndfile_win32.pxiH A D27-Jul-20191.3 KiB2927

README.md

1# pysndfile
2
3pysndfile is a python package providing *PySndfile*, a [Cython](http://cython.org/) wrapper class around [libsndfile](http://www.mega-nerd.com/libsndfile/). PySndfile provides methods for reading and writing a large variety of soundfile formats on a variety of plattforms. PySndfile provides a rather complete access to the different sound file manipulation options that are available in libsndfile.
4
5Due to the use of libsndfile nearly all sound file formats, (besides mp3 and derived formats) can be read and written with PySndfile.
6
7The interface has been designed such that a rather large subset of the functionality of libsndfile can be used, notably the reading and writing of strings into soundfile formats that support these, and a number of sf_commands that allow to control the way libsndfile reads and writes the samples. One of the most important ones is the use of the clipping command.
8
9## Transparent soundfile io with libsndfile
10
11PySndfile has been developed in the  [analysis synthesis team at IRCAM](http://anasynth.ircam.fr/home/english) mainly for research on sound analysis and sound transformation. In this context it is essential that the reading and writing of soundfile data is transparent.
12
13The use of the clipping mode of libsndfile is important here because  reading and writing sound data should not change the audio samples. By default, when clipping is off, libsndfile uses slightly different scaling factors when reading pcm format into float samples, or when writing float samples into pcm format. Therefore whenever a complete read/write cycle is applied to a sound file then the audio samples may be modified even when no processing is applied.
14
15More precisely this will happen if
16
17 * the sound files contains pcm format,
18 * *and* the data is read into float or double,
19 * *and* the audio data comes close to the maximum range such that the difference in scaling leads to modification.
20
21To avoid this problem PySndfile sets clipping by default to on. If you don't like this you can set it to off individually using the PySndfile method set_auto_clipping(False).
22
23## Implementation
24
25The implementation is based on a slightly modified version of the header sndfile.hh that is distributed with libsndfile. The only modification is the addition of a methode querying the seekable state of the open Sndfile.
26
27## Installation
28
29### via Anaconda channel roebel
30
31Precompiled packages are available for [Anaconda python3](https://anaconda.org/roebel/pysndfile) under
32Linux (x86_64) and Mac OS X (> 10.9). For these systems you can install pysndfile
33simply by means of
34
35```bash
36conda install -c roebel pysndfile
37```
38
39Unfortunately, I don't have a windows machine and therefore I cannot provide any packages for
40Windows.
41
42### compile with conda build recipe
43
44You can use the conda recipe [here](https://github.com/roebel/conda_packages).
45This build recipe wil automatically download and compile libsndfile building pysndfile.
46
47### via pypi
48
49```
50pip install pysndfile
51```
52
53should install pysndfile and python dependencies. Note, that pip cannot install libsndfile for you
54as it is not provided via pypi. To install libsndfile you should be able to use the software manager
55of your system. This will however only work if your software manager installs libsndfile
56such that the compiler used by the setup.py script will find it.
57
58### compile from sources
59
60Note that for ompiling from sources you need to install requirements listed in requirements.txt file before starting the compilation. Moreover you need to install libsndfile as described in the previous section.
61
62If the libsndfile (header and library) is not installed in the default compiler search path you have to
63specify the library and include directories to be added to this search paths. For this you can use either the
64command line options --sndfile-libdir and --sndfile-incdir that are available for the build_ext command
65or specify these two parameters in the setup.cfg file.
66
67#### Windows ####
68
69An experimental support for using pysndfile under windows has been added since version
701.3.4. For further comments see [here](https://github.com/roebel/pysndfile/issues/3)
71as well as [build scripts](https://gist.github.com/sveinse/97411b95d36a6b8c430d4d381b620ecb)
72provided by sveinse. Note, that I do not have any windows machine and cannot provide
73any help in making this work.
74
75## Documentation
76
77Please see the developer documentation [here](https://pysndfile.readthedocs.io/en/latest/modules.html).
78
79## Changes
80
81### Version_1.4.3 (2020-01-20)
82
83 * changed sndio functions to all use PySndfile as context manager. This fixes the problem that the sndfile
84   remains open when an error occurs which may in turn lead to inconsistencies if the sndfile is tried to be rewritten
85   in an exception handler.
86
87### Version_1.4.2 (2019-12-18)
88
89 * fixed PySndfile.read_frames method to properly handle reading frames in parts (previous fix was incomplete)
90
91### Version_1.4.1 (2019-12-18)
92
93 * extended supported commands to change compression level when writing flac and ogg files
94 * fixed PySndfile.read_frames and sndio.read method to properly handle reading frames from the middle of a file
95
96### Version_1.4.0 (2019-12-17)
97
98 * Extended PySndfile class:
99    * support use as context manager
100    * added support for wve, ogg, MPC2000 sampler and RF64 wav files
101    * added support for forcing to return 2D arrays even for mono files
102    * added method to close the file and release all resources.
103    * support reading more frames than present in the file using the fill_value for all values positioned after the end of the file
104
105### Version_1.3.8 (2019-10-22)
106
107 * (no changes in functionality)
108 * added documentation to distributed files
109 * added missing licence file to distribution
110 * thanks @toddrme2178 for patches.
111
112### Version_1.3.7 (2019-08-01)
113
114 * removed cython (a build requirement) from requirements.txt
115 * avoid cython warning and fix language_level in the .pyx source code
116 * add and support pre-release tags in the version number
117 * use hashlib to calculate the README checksum.
118 * fixed support for use with python 2.7 that was broken since 1.3.4
119
120### Version_1.3.6 (2019-07-27)
121
122 * fixed potential but undesired build dependency of pandoc
123 * added link to explanation for using pysndfile under windows
124 * fixed pandoc problem that does produce non ASCII chars in rst output.
125
126### Version_1.3.5 (2019-07-27)
127
128 * fixed two copy paste bug introduced in 1.3.4
129 1.3.4 did in fact not work at all :-(
130 * added a check target to the makefile that performs a complete built/install/test cycle
131 to avoid problems as in 1.3.4
132
133### Version_1.3.4 (2019-07-23)
134
135 * added support for automatic installation of requirements
136 * remove precompiled cython source file and rely on pip requirements to provide cython
137   so that cython compilation will always be possible.
138 * added experimental support for installation on win32 (thanks
139   to Svein Seldal for the contributions).
140 * use expanduser for replacing ~ in filenames
141 * adapted cython source code to avoid all compiler warnings due to deprecated numpy api
142 * removed use of ez_setup.py that is no longer required.
143
144### Version_1.3.3 (2019-06-01)
145
146 * fixed missing command C\_SFC\_SET\_SCALE\_INT\_FLOAT\_WRITE (thanks
147   to Svein Seldal for the bug report and fix)
148 * better documentation of sf\_string-io in sndio.read and sndio.write
149 * limit size of strings to be written such that the written file can
150   always be read back with libsndfile 1.0.28 (which imposes different
151   constraints for different formats)
152 * better error handling when number of channels exceeds channel limit
153   imposed by libsndfile.
154 * sndio module now exposes the dicts: fileformat\_name\_to\_id
155   and fileformat\_id\_to\_name
156 * extended sndio.read with force_2d argument that can be used to
157   force the returned data array to always have 2 dimensions even for
158   mono files.
159
160### Version_1.3.2 (2018-07-04)
161
162 * fixed documentation of sndio module.
163
164### Version_1.3.1 (2018-07-04)
165
166 * Extended sndio by means of adding a enw function that allows retrieving embed markers
167   from sound files. Names marker labels will be retrieved only for aiff files.
168 * removed print out in pysndfile.get_cue_mrks(self) function.
169 * fixed version number in documentation.
170
171### Version_1.3.0 (2018-07-04)
172
173 * Added support for retrieving cue points from aiff and wav files.
174
175### Version_1.2.2 (2018-06-11)
176
177 * fixed c++-include file that was inadvertently scrambled.
178
179### Version_1.2.1 (2018-06-11)
180
181 * fixed formatting error in long description and README.
182 * setup.py to explicitly select formatting of the long description.
183
184### Version_1.2.0 (2018-06-11)
185
186 * support reading and writing sound file strings in sndio module
187 * Improved documentation of module constant mappings and PySndfile methods.
188 * Added a new method supporting to write all strings in a dictionary to the sound file.
189
190### Version_1.1.1 (2018-06-10)
191
192this update is purely administrative, no code changes
193
194 * moved project to IRCAM GitLab
195 * moved doc to ReadTheDoc
196 * fixed documentation.
197
198### Version_1.1.0 (2018-02-13)
199
200 * support returning extended sndfile info covering number of frames and number of channels
201   from function sndio.get_info.
202
203### Version_1.0.0 (2017-07-26)
204
205 * Updated version number to 1.0.0:
206  - pysndfile has now been used for quiet a while under python 3 and most problems seem to be fixed.
207  - changed setup.py to avoid uploading outdated LONG_DESC file.
208
209### Version_0.2.15 (2017-07-26)
210
211 * fixed get_sndfile_version function and tests script:
212	adapted char handling to be compatible with python 3.
213
214### Version 0.2.14 (2017-07-26)
215
216 * fixed filename display in warning messages due to invalid pointer:
217    replaced char* by std::string
218
219### Version 0.2.13 (2017-06-03)
220
221 * fixed using "~" for representing $HOME in filenames:
222 * _pysndfile.pyx: replaced using cython getenv by os.environ to avoid
223    type incompatibilities in python3
224
225### Version 0.2.12 (2017-05-11)
226
227 * fixed problem in sndio.read:
228  Optionally return full information required to store the file using the corresponding write function
229 * _pysndfile.pyx:
230  add constants SF_FORMAT_TYPEMASK and SF_FORMAT_SUBMASK, SF_FORMAT_ENDMASK to python interface
231  Added new function for getting internal sf log in case of errors.
232  Improved consistency of variable definitions by means of retrieving them automatically from sndfile.h
233
234### Version 0.2.11 (2015-05-17)
235
236 * setup.py: fixed problem with compilers not providing the compiler attribute (MSVC) (Thanks to Felix Hanke for reporting the problem)
237 * _pysndfile.pyx: fixed problem when deriving from PySndfile using a modified list of __init__ parameters in the derived class
238     (Thanks to Sam Perry for the suggestion).
239
240### Version 0.2.10
241
242 * setup.py: rebuild LONG_DESC only if sdist method is used.
243
244### Version 0.2.9
245
246 * Added missing files to distribution.
247 * force current cythonized version to be distributed.
248
249### Version 0.2.4
250
251 * Compatibility with python 3 (thanks to Eduardo Moguillansky)
252 * bug fix: ensure that vectors returned by read_frames function own their data.
253
254## Copyright
255
256Copyright (C) 2014-2018 IRCAM
257
258## Author
259
260Axel Roebel
261
262## Credits
263
264 * Erik de Castro Lopo: for [libsndfile](http://www.mega-nerd.com/libsndfile/)
265 * David Cournapeau: for a few ideas I gathered from [scikits.audiolab](http://cournape.github.io/audiolab/).
266 * The [Cython](http://cython.org) maintainers for the efficient means to write interface definitions in Cython.
267

README.md.cksum

111532 fb9c6e00c3c545f2f72e1179a6c64d66d1b639a3f2123f90a6b22c4c6ec0f6c1
2