samplerate 0.2.2__cp312-cp312-macosx_10_13_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,124 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: samplerate
|
3
|
+
Version: 0.2.2
|
4
|
+
Summary: Monolithic python wrapper for libsamplerate based on pybind11 and NumPy
|
5
|
+
Author-email: Robin Scheibler <fakufaku@gmail.com>, Tino Wagner <ich@tinowagner.com>
|
6
|
+
License: MIT
|
7
|
+
Keywords: samplerate,converter,signal processing,audio
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
9
|
+
Classifier: Environment :: Console
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
16
|
+
Classifier: Topic :: Multimedia :: Sound/Audio
|
17
|
+
Requires-Python: >=3.7
|
18
|
+
Description-Content-Type: text/x-rst
|
19
|
+
License-File: LICENSE.rst
|
20
|
+
Requires-Dist: numpy
|
21
|
+
Dynamic: license-file
|
22
|
+
|
23
|
+
python-samplerate
|
24
|
+
=================
|
25
|
+
|
26
|
+
.. image:: https://img.shields.io/pypi/v/samplerate.svg
|
27
|
+
:target: https://pypi.python.org/pypi/samplerate
|
28
|
+
|
29
|
+
.. image:: https://img.shields.io/pypi/l/samplerate.svg
|
30
|
+
:target: https://pypi.python.org/pypi/samplerate
|
31
|
+
|
32
|
+
.. image:: https://img.shields.io/pypi/wheel/samplerate.svg
|
33
|
+
:target: https://pypi.python.org/pypi/samplerate
|
34
|
+
|
35
|
+
.. image:: https://img.shields.io/pypi/pyversions/samplerate.svg
|
36
|
+
:target: https://pypi.python.org/pypi/samplerate
|
37
|
+
|
38
|
+
.. image:: https://readthedocs.org/projects/python-samplerate/badge/?version=latest
|
39
|
+
:target: http://python-samplerate.readthedocs.io/en/latest/?badge=latest
|
40
|
+
:alt: Documentation Status
|
41
|
+
|
42
|
+
|
43
|
+
This is a wrapper around Erik de Castro Lopo's `libsamplerate`_ (aka Secret
|
44
|
+
Rabbit Code) for high-quality sample rate conversion.
|
45
|
+
|
46
|
+
It implements all three `APIs
|
47
|
+
<http://www.mega-nerd.com/libsamplerate/api.html>`_ available in
|
48
|
+
`libsamplerate`_:
|
49
|
+
|
50
|
+
* **Simple API**: for resampling a large chunk of data with a single library
|
51
|
+
call
|
52
|
+
* **Full API**: for obtaining the resampled signal from successive chunks of
|
53
|
+
data
|
54
|
+
* **Callback API**: like Full API, but input samples are provided by a callback
|
55
|
+
function
|
56
|
+
|
57
|
+
The `libsamplerate`_ library is statically built together with the python bindings
|
58
|
+
using `pybind11 <https://github.com/pybind/pybind11/>`_.
|
59
|
+
|
60
|
+
|
61
|
+
Installation
|
62
|
+
------------
|
63
|
+
|
64
|
+
$ pip install samplerate
|
65
|
+
|
66
|
+
Binary wheels of `libsamplerate`_ for macOS and Windows (64 bit) are available.
|
67
|
+
For other systems, a C++ 14 or above compiler is required to build the package.
|
68
|
+
|
69
|
+
|
70
|
+
Usage
|
71
|
+
-----
|
72
|
+
|
73
|
+
.. code-block:: python
|
74
|
+
|
75
|
+
import numpy as np
|
76
|
+
import samplerate
|
77
|
+
|
78
|
+
# Synthesize data
|
79
|
+
fs = 1000.
|
80
|
+
t = np.arange(fs * 2) / fs
|
81
|
+
input_data = np.sin(2 * np.pi * 5 * t)
|
82
|
+
|
83
|
+
# Simple API
|
84
|
+
ratio = 1.5
|
85
|
+
converter = 'sinc_best' # or 'sinc_fastest', ...
|
86
|
+
output_data_simple = samplerate.resample(input_data, ratio, converter)
|
87
|
+
|
88
|
+
# Full API
|
89
|
+
resampler = samplerate.Resampler(converter, channels=1)
|
90
|
+
output_data_full = resampler.process(input_data, ratio, end_of_input=True)
|
91
|
+
|
92
|
+
# The result is the same for both APIs.
|
93
|
+
assert np.allclose(output_data_simple, output_data_full)
|
94
|
+
|
95
|
+
# See `samplerate.CallbackResampler` for the Callback API, or
|
96
|
+
# `examples/play_modulation.py` for an example.
|
97
|
+
|
98
|
+
See ``samplerate.resample``, ``samplerate.Resampler``, and
|
99
|
+
``samplerate.CallbackResampler`` in the API documentation for details.
|
100
|
+
|
101
|
+
|
102
|
+
See also
|
103
|
+
--------
|
104
|
+
|
105
|
+
* `scikits.samplerate <https://pypi.python.org/pypi/scikits.samplerate>`_
|
106
|
+
implements only the Simple API and uses `Cython <http://cython.org/>`_ for
|
107
|
+
extern calls. The `resample` function of `scikits.samplerate` and this package
|
108
|
+
share the same function signature for compatiblity.
|
109
|
+
|
110
|
+
* `resampy <https://github.com/bmcfee/resampy>`_: sample rate conversion in
|
111
|
+
Python + Cython.
|
112
|
+
|
113
|
+
|
114
|
+
License
|
115
|
+
-------
|
116
|
+
|
117
|
+
This project is licensed under the `MIT license
|
118
|
+
<https://opensource.org/licenses/MIT>`_.
|
119
|
+
|
120
|
+
As of version 0.1.9, `libsamplerate`_ is licensed under the `2-clause BSD
|
121
|
+
license <https://opensource.org/licenses/BSD-2-Clause>`_.
|
122
|
+
|
123
|
+
|
124
|
+
.. _libsamplerate: http://www.mega-nerd.com/libsamplerate/
|
@@ -0,0 +1,6 @@
|
|
1
|
+
samplerate.cpython-312-darwin.so,sha256=m1lX0xK8L9bekp630PPjuYzT-Ni3V7IcsgZfhK0EvMM,3491616
|
2
|
+
samplerate-0.2.2.dist-info/licenses/LICENSE.rst,sha256=Mkl9WQVGlvUEMLz4SQJQAoSHeEyWPG1riOE4nqsmUMs,1099
|
3
|
+
samplerate-0.2.2.dist-info/METADATA,sha256=W-Y2zPLJFuXDS9dielgASRg0jB5NGfnBOREavslRfvM,3932
|
4
|
+
samplerate-0.2.2.dist-info/WHEEL,sha256=_N1vyLgwJ10g4JxFsp-IfU42zGJgf-DUqwfdbV1YvEM,115
|
5
|
+
samplerate-0.2.2.dist-info/top_level.txt,sha256=D98x79TWV9Q1_HNr1nlmtMWQJTYZfEgMgy76u0CbJxs,11
|
6
|
+
samplerate-0.2.2.dist-info/RECORD,,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
=====================
|
3
|
+
|
4
|
+
Copyright © 2017 Tino Wagner
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person
|
7
|
+
obtaining a copy of this software and associated documentation
|
8
|
+
files (the "Software"), to deal in the Software without
|
9
|
+
restriction, including without limitation the rights to use,
|
10
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the
|
12
|
+
Software is furnished to do so, subject to the following
|
13
|
+
conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be
|
16
|
+
included in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
20
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
22
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
23
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
24
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
25
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
samplerate
|
Binary file
|