High quality, one-dimensional sample-rate conversion library
Project description
Python-SoXR
High quality, one-dimensional sample-rate conversion library for Python
Installation
pip install soxr
If installation fails, upgrade pip with python -m pip install --upgrade pip
and try again.
Basic usage
import soxr
y = soxr.resample(
x, # 1D(mono) or 2D(frames, channels) array input
48000, # input samplerate
16000 # target samplerate
)
If input is 1D array, output is 1D numpy.ndarray with shape (frames).
If input is 2D array, output is 2D numpy.ndarray with shape (frames, channels).
Streaming usage
Use ResampleStream
for real-time processing or very long signal.
import soxr
rs = soxr.ResampleStream(
44100, # input samplerate
16000, # target samplerate
1, # channel(s)
dtype='float32' # optional data type (default = np.float32)
)
eof = False
while not eof:
# Get chunk
...
y_chunk = rs.resample_chunk(
x, # 1D(mono) or 2D(frames, channels) array input
last=eof # Set True at end of input
)
Output frame count may not be consistent. This is normal operation.
(ex. [0, 0, 0, 186, 186, 166, 186, 186, 168, ...])
OSS libraries used
libsoxr (LGPLv2.1+)
The SoX Resampler library
https://sourceforge.net/projects/soxr/
Python-SoXR is a Python wrapper of libsoxr.
PFFFT (BSD-like)
PFFFT: a pretty fast FFT.
https://bitbucket.org/jpommier/pffft/
libsoxr dependency.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for soxr-0.2.1-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff2c63a66c45d5b6048004bd9b3e84ab61688d542ae090e2c39ffc4918cee9d6 |
|
MD5 | f8a4515bba4867be062889a99d4cae4c |
|
BLAKE2b-256 | 8401886532a08b8a64d07c95cc5c15f3b0ba5d2cfac82d16cde6124007fd6d33 |
Hashes for soxr-0.2.1-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f1ede957fff99eb8ee0527ff970283e32e0baee61de0981a0ca75737692c7b |
|
MD5 | 505428c9712239c4a2c32424c81233d9 |
|
BLAKE2b-256 | 3f6380c418ab11e300de5c978ba144601591404ca88079506fd45ae9dbb0a449 |
Hashes for soxr-0.2.1-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f0c5591a4aeac0e3b1606bfa5d60bc3dc5f842787e4331babd962005fff886 |
|
MD5 | da032695d644988d6c7aaca5f4481a45 |
|
BLAKE2b-256 | ad1eae8b6f1aec6f922994385b8ce9aa548a1b98d9f0c67ddb2367bf29b26d47 |
Hashes for soxr-0.2.1-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd96897408400c92d33706cb2fa4ce85e33fd03e1acc93d256915eef91faecb |
|
MD5 | e63006d5ea12da93be3ea18a2e9c635f |
|
BLAKE2b-256 | 425ac339aab63e94a0f023ed5021c8cf283eb11a0d16acb7725a134abb034491 |
Hashes for soxr-0.2.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ff4fff496f7e3d218579b1954212497e561c153a5c97d1e26ad250bfcfc1bca |
|
MD5 | a85b4b093a57eee139293c47b840ad39 |
|
BLAKE2b-256 | d21f3da35b80a10f641a70eb0af624c7ebd364024f99a38d9de8617d9ee994f9 |
Hashes for soxr-0.2.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1213bff760ac5a76db3c685a3007b099f98dd7a2a704c56597ee6cf8707213ab |
|
MD5 | 2212e4b1c6d64b3ba308bf1f639648ee |
|
BLAKE2b-256 | b3e1c8eaf66e3e80f5836a8bab3b715031266e86261dbcf214f8c6cbeaf35154 |
Hashes for soxr-0.2.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd7e5ac9c0e97066a4283c671edae0b2cb3937f40a1852a77aff26827c080187 |
|
MD5 | 9de4a693b0bedd6ee5ff681aae808ec1 |
|
BLAKE2b-256 | 1988cf0788403d3b2ac18f7974a8a4a761bcfcd2137b04eae835abd9b2520b59 |
Hashes for soxr-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 040f7159d6b780de00e3d6bdecb66b6b21d4f2e1b874c2a8862b7d1532f2e2cc |
|
MD5 | 97011d891472bef0d7328f2c3e517176 |
|
BLAKE2b-256 | 041916e1e23f57bc9d1234f3e9755e6bcf9c0f1c003da645f7011e37eebe23d9 |
Hashes for soxr-0.2.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb892a421dc5b3adc720df9e13dee2c47ec80cfbee07810a268bbfaef6456d58 |
|
MD5 | 7b0d21fe2ac5439518729f5c88bc5502 |
|
BLAKE2b-256 | 9c8a0d1b97889bc2399a59bfa4f5e81a8a9f8614948d615ba1cc3d1c2379b3f4 |
Hashes for soxr-0.2.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e18a29a88fa7b035556e6f02428574ac7ea17df4a63de6fd16a59e4a7080d3 |
|
MD5 | e65207189101abe80b6a52b693c4dfeb |
|
BLAKE2b-256 | 5d80d096b03859076bbc8198b03e41a6c3099eec6ffe278e10af1b03defc2b36 |
Hashes for soxr-0.2.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88dec4b74cf331e408ad6171bfb118ba5cf6beb22fa285e4f3eaf5f845c0a31d |
|
MD5 | 9370927087a4332384ee433beb336721 |
|
BLAKE2b-256 | c2e308da18c689b7e98802ab1862f6ecd0274d43ad0e070b4a936afc6801d727 |
Hashes for soxr-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17162ec5f3b36a887aa2c8ec6f4db2eb35ef50eb3e95bc776b2b1e2ac88b247e |
|
MD5 | 8d7a29310a7f5730c8685a8c46a4912d |
|
BLAKE2b-256 | a22e181ece61ed5185f391ce2c3ee7e864ca1edf3c805c9ddf0f3fbbcfef1cab |
Hashes for soxr-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e3ed2aad961492b6c0cb8c00b576cc185aa96c06ea254ef5e1570ae2e9f8f6f |
|
MD5 | 572c110d2aebc7775a5e76e053234330 |
|
BLAKE2b-256 | 0ff10d8292a860c11464d04ae53e42a6c29c9fc3d6804d9688085eff3b6189a3 |
Hashes for soxr-0.2.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fbadc78678fa75c4554c22f03865716b74019c8443a299e4d1c43ebb8a9a75e |
|
MD5 | 2b8a48cdb67e82841f202514c72bbc9d |
|
BLAKE2b-256 | 2890cf834aa410daf6c6502281ee03b0b001001502091dad75650d082b695645 |
Hashes for soxr-0.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4ca8c27bab1288ce9343249c6f2ba4a67d4df543147a0f3f6192fba1fe57426 |
|
MD5 | 316c818ed92c56d032c0765a7ecc7db0 |
|
BLAKE2b-256 | 7de0b0f3fce823fa1225280f477cdcf8864d6cc15058876bd878653447f7a630 |
Hashes for soxr-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbb77608734bc35881774673971c13836c089da1801098c3d6db929b7b6262da |
|
MD5 | 63e4f9cb5dd5d9be4ba27cbdf59a4916 |
|
BLAKE2b-256 | f343f66f785a6c0f0849816a06ea7886d10e864346a39c19fe534d1478a139db |
Hashes for soxr-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52a3b423085103ed4bd9d5ca71b4fc09ad00860088d410276f5582773989bfce |
|
MD5 | 94f34a15935af282d838d411c5f2dc8e |
|
BLAKE2b-256 | 4a59a24acdcc110c9b1c348b6cde7a595353f471386f79fd5f7e3c564ea6c6bc |
Hashes for soxr-0.2.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976a37254b02e38326e516e551f5cc5f5160c0c5653b62e5390a35f5cb7a8112 |
|
MD5 | 5e2f6fb7c43d8128f78242d97d19133c |
|
BLAKE2b-256 | 93b52180f84c960cc917bdbc04fddb3ff62cd5c81c443aad40fed63a37592cb9 |
Hashes for soxr-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda04a892e03de41a1258931a3e2a11dc68e38bb62471c920aeec2f5d87cd387 |
|
MD5 | 2520febfb6283c11dd88c2e155ed35e2 |
|
BLAKE2b-256 | 2d9adddf25d3a8599a2fc74f68b73b934d4d3bfd93e4eca3c183a69923c8c749 |
Hashes for soxr-0.2.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73cd07ce8e9881b348eed8a373fc1f9bd90274d83cb9d60849c9e8d33b7b3b9 |
|
MD5 | 54ff2bfe038f72ea16d34d9ad9a7fc8f |
|
BLAKE2b-256 | 1e0afb5e39f9f0dc974096fe9df651cef0238b9699fec5988f60d3f1e2e7dfdc |