Python bindings for the RubberBand library
Project description
pylibrb
pylibrb (py-lib-rubberband) is a simple Python extension exposing Rubber Band Library using nanobind bindings.
Since this is not a wrapper around a command-line tool (like pyrubberband), both offline and real-time modes are available.
Currently this extenstion exposes only a single class: RubberBandStretcher
, which implements all the functionalities of the underlying C++ class. The interface is nearly identical to the original library, with a few changes to make it a bit more Pythonic by:
- using
snake_case
for functions, variables and properties, andSNAKE_CASE
for constants - not using (magic) numbers to represent the state
- use
is_done()
to see if all the data has been processed and returned from the stretcher, instead ofavailable() == -1
- use
stretcher.formant_scale = pylibrb.AUTO_FORMANT_SCALE
instead ofstretcher.formant_scale = 0
- use
Throughout the library, audio is accepted and returned in the form of NumPy ndarrays.
Example
from pylibrb import RubberBandStretcher, Option, create_audio_array
# create a stretcher
stretcher = RubberBandStretcher(sample_rate=16000,
channels=1,
options=Option.PROCESS_REALTIME | Option.ENGINE_FINER,
initial_time_ratio=0.5)
stretcher.set_max_process_size(1024)
# provide the audio to the stretcher, until some output is available
audio_in = create_audio_array(channels_num=1, samples_num=1024)
while not stretcher.available():
audio_in[:] = 0 # get the next batch of samples, here we just use silence
stretcher.process(audio_in)
# retrieve the available samples
audio_out = stretcher.retrieve_available()
For more instructions, read the docstings of the RubberBandStretcher
class and the Option
enum, or see the documentation of Rubber Band Library.
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 pylibrb-0.0.9-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43544170d6a53868339ab8db84407e900069de4fdf7156bb856784b4dd570cde |
|
MD5 | d3a2acccd1286aec6fc78819b200ee72 |
|
BLAKE2b-256 | 3a3e2fef3436e1c9e20310dd9ef61b08d82664957ddd8b1528d310503168b268 |
Hashes for pylibrb-0.0.9-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55e84e5bdc8118c24ddcca9cfbcbaa8cfcc12813ecf3cf0a3842dfdde7eab460 |
|
MD5 | b0f94748d00003e71d45683e8ce7a7c1 |
|
BLAKE2b-256 | 5d1a239abdf92a28f5c014e7fd10cabec5f9e6dbe00174f0bac24798dfa527ad |
Hashes for pylibrb-0.0.9-pp39-pypy39_pp73-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2c304ba0b0d20f514f86b93cc1683348f16e618e7cf13334d659b2c6a755a0b |
|
MD5 | 1234941f71ed0e85453254c2d3669f3b |
|
BLAKE2b-256 | a74b99742b2761e26e59f55034800e6e5a4f789c9308d2b1a0e8f4ed83cc5e6a |
Hashes for pylibrb-0.0.9-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5da0da0d4783a89bdf9663480d49ddb8a8caff918c6d044d5a29216461cdcec1 |
|
MD5 | 9769571eceda75f8d095e90cbe900b2d |
|
BLAKE2b-256 | d561f70099893a4727eb323d2b61e05330374970378378e126927dbb1c601ea2 |
Hashes for pylibrb-0.0.9-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abf4a1e034f8316d1eeed7cbc38be7f1e3c063f911ec54b175dcc4b0781d67e9 |
|
MD5 | fd4180084737a138c619db84fe054631 |
|
BLAKE2b-256 | 375eb01441712bd654a4477c80ae690a52ece8a9be95bdc0a14ae441dde9ab75 |
Hashes for pylibrb-0.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f198f085bd32d960b9b475cc102470d0ae023b4cb9208dc35d4b2fa3f2f0cba |
|
MD5 | 0ed2224ea20fcd9694812d5bc75cc23c |
|
BLAKE2b-256 | f1815b8a830cdb633f5cf3c9dbfe74a4e57cb5fb37cfe7502010186fc61d9c4b |
Hashes for pylibrb-0.0.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fd2b666871314db478ea821159a20d2be48e778652a0c71960811eeec986478 |
|
MD5 | b6d065f5b55bfee18db7439dbe3d5e1e |
|
BLAKE2b-256 | 6eeb1bafbae7e4e52375833fffd486f1625672e658ba41c685b7d4b97b13b774 |
Hashes for pylibrb-0.0.9-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749024f681698c0a3115d2a68e95f2574cb4d19eb823f8bfba1eb49e6bb7e139 |
|
MD5 | e7947f3858ac35a5e12dab134995bf7d |
|
BLAKE2b-256 | e4921b410d894c33a4160d39268dacc29c5db9cdba5e588d2d38239146301e77 |
Hashes for pylibrb-0.0.9-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a92d962ae29975eccccf993eda9ff816addaf5b2f345dd8ee39410ab5d881ff9 |
|
MD5 | 3adebcae3508bf59a6f298e1c697c45c |
|
BLAKE2b-256 | 84048f2aab915bf0c15593d57aa7c04ac21092905f4509e8503d4784b8cac598 |
Hashes for pylibrb-0.0.9-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f415d3ab4e9b068a7b27debce579170db869dc26047219a8ab71b1a8276f43a |
|
MD5 | b1c3faa0655b2dccb70abf9dc3f7afe8 |
|
BLAKE2b-256 | 9e11737d229e6d1936127a9231a122c00ea374e0b2a831641df263bcf6c74932 |
Hashes for pylibrb-0.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a8a4294ab25251c4335ef413e3c28414d71e19367a6133efa15e74421abeaa2 |
|
MD5 | e7ca66e0d5f2ee623a97ed61a8e05755 |
|
BLAKE2b-256 | 55333f30c6c3b0daf791e773b48a7f79c61d8137b1f58428d4579ef50c25bd75 |
Hashes for pylibrb-0.0.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da9c6e3f36e4c26c730d0dfd58362922764be20cd657100dfa399d85e1a00e63 |
|
MD5 | 15a62571849b676069c191391881490f |
|
BLAKE2b-256 | 67af99659ff4778d37cc6f997fe467c07eb7caa608335eca475d8eed3e6fa368 |
Hashes for pylibrb-0.0.9-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6abe99dff4a4fd3a0d80e461e9cdcb5d7cc03dcf6d4de927ae97b58103db81e8 |
|
MD5 | 9be70bf53739149039b0bbcba494e896 |
|
BLAKE2b-256 | e420dca047bf4725df6cc0ea648d72fb3e420a08c96084cd2f837758cf050e2b |
Hashes for pylibrb-0.0.9-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5bef4e39654f2bf050d7a1f31285b4807fa32606cfaba1cb9d426d94c95a1f |
|
MD5 | 05aac2d57185a06a23b9d9963468b958 |
|
BLAKE2b-256 | ea42e13cde0d7feca3011ff8076b4d70371b3e03152c97b6fe7121f6f0be429e |
Hashes for pylibrb-0.0.9-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c4eb6e00df6d0370fa837f2554c923b6e5861f5a3c9f8e5692d543e998c511 |
|
MD5 | c65a7dd2170ff5e46a8dcf83b5be1b83 |
|
BLAKE2b-256 | bf98c1906a7898df1b550f8dd4e2ce8958ff8c88f5c46037185f752ee415276c |
Hashes for pylibrb-0.0.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adae6e4d19836e35b817a995bef44c185784460e4c4e3918b5e5072954ad2968 |
|
MD5 | e08b30b62155b7ec7ed3519d0ae136f2 |
|
BLAKE2b-256 | d82dec811cc98bf2cd9a4caa67803b5e1d7e7f7d6bed24cda8f6f098c1389374 |
Hashes for pylibrb-0.0.9-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61f1c6fb18279cc6258323945ef849ed95bc5e077d7c1fada6e9a333504f5528 |
|
MD5 | 21973c8fde0cc2c9b6eed3eced8210bb |
|
BLAKE2b-256 | b0af13adf3c8b5c26719f5b2a0aa322d4420f68309ec211ffd0b2e46b3d5d24e |
Hashes for pylibrb-0.0.9-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66140421272474bc5ef69938573ffd25e5dbad1a7831934b425fd75a51c817e1 |
|
MD5 | e34486ecdc8857a780504c5a5bd16586 |
|
BLAKE2b-256 | 0a1d58c004efcc06191aef1115b735c08a9f788314b86251a67f1fd86aabf5f6 |
Hashes for pylibrb-0.0.9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddbc4b8adc92ac03f9c3d3b95feff4c68991129c9da99d6daac5f1e744a846a9 |
|
MD5 | 7e0f83c17663128991deb02d4f5c4e96 |
|
BLAKE2b-256 | 73217292fe9b0d584582c320def3db3d8ec4d4f20f045d2baf8936a7498d97ea |
Hashes for pylibrb-0.0.9-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e883e2141116f4b5acc4e9bbdcff492f14c9d4527f2c2dcf8b208a5ea2270f6 |
|
MD5 | 5f9435d0f7e132440913a8f0e0d302ca |
|
BLAKE2b-256 | c2c66e249d7450ac95c3c64734d9288e983a09052c150fe647d87dec35c2340d |
Hashes for pylibrb-0.0.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf074128da71e5e903a41458f03ed2696323d40f6878fec760fce27eb7e0687 |
|
MD5 | 7ab4e9a72aa6f1afa2a333064e0b374a |
|
BLAKE2b-256 | b9be5de4a93ec0f677ffdb6c7536d131a3ef601af38849ba9381f5d7eb1786f8 |
Hashes for pylibrb-0.0.9-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e93d45d373f73bc7c22ba1bd3d1833bf5604d5ecffe651f810d475e9238acde2 |
|
MD5 | 52482ec7e5cbcb68b9ebdf361fbdafa7 |
|
BLAKE2b-256 | 1c19d9f76f31c00197bf039e66ce32d664d60b6f3fbe1fd3451adae185052d46 |
Hashes for pylibrb-0.0.9-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b6a4f57685ff7362db32d0341a725c5ef593e773cd0dcc3d3007bea5e8d3cfd |
|
MD5 | e1ea16ab998aeb5f13d6357df849ead7 |
|
BLAKE2b-256 | 08822bfb9b616effc2d7637b76edc6f4a95c29e3234743b2994801d3e16ec794 |