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.1.2-cp312-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab810bd58581da194b4c4bfb8883033dc122a63842ba8d27e2faad084761fe6 |
|
MD5 | 47bd189d9434fea8f93733ae5120fed5 |
|
BLAKE2b-256 | f8e05cbac14c76f8e3cf151c2b6444fe340eeaf9f3097016a5ad205bbc4e753f |
Hashes for pylibrb-0.1.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7088cb716fe07540f28bd26bf11315eec73fe6578a7d1d7d55d07019190098df |
|
MD5 | 2c139a9e5c3ba45e41429bf10def70a0 |
|
BLAKE2b-256 | fcdc6611dd8376ffcb388d53cc9f3c05417091e74e828b2b3e04ec08cfaa2445 |
Hashes for pylibrb-0.1.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60380fd59fb286700d3f950e9db6388cee1b27a1ab27a1c6ee8e509fd9cd68cf |
|
MD5 | 97c73652938f1f44864449381b9fcf7a |
|
BLAKE2b-256 | f64409da209c85c1a669d0947dca139d116c78fe452b9bcbc3c64bc3972f729a |
Hashes for pylibrb-0.1.2-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24bd04333ca0e8a08f6763de16c3932adb1d45ff8b07103c388322b8e3a4bc98 |
|
MD5 | 5982c65710cae2c57786e51b185519d5 |
|
BLAKE2b-256 | ec321afbc08d701bce9b36f50825f3cb9028b0cee1f0caacd0342cbcf4bb3b13 |
Hashes for pylibrb-0.1.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0815af8a5e8ad2c10f85f70fa5906943ac8f70b823f4e40c9e80d70c292399f9 |
|
MD5 | 8ca020c6983aa4bb7d33a0e7050d258d |
|
BLAKE2b-256 | 035f5a2858df85e4dc9095c38dd4d97b76f1706e10334c7e57c967c2baf74325 |
Hashes for pylibrb-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be5d357b1801eac7676e18a04b02e4d979c75f0b453dfbb14b95e69154d0844 |
|
MD5 | 0992974735e2950349a27875873fe712 |
|
BLAKE2b-256 | 9e012d7c14f25fd5dd2af3319fdf09a8370eaae1acd700d2695a55bf9b3d2a2c |
Hashes for pylibrb-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c93ac459d219348ec8ea41fcb0e8a37a2dd8dde23e7ec60af7a2555702623a3 |
|
MD5 | fe75ec1c3caae376b51fb6f504a2ff08 |
|
BLAKE2b-256 | b84b912369be7e3bc667117c5fe645b1022a7d970733a6ee1123d2f305ee133e |
Hashes for pylibrb-0.1.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f671a61761dd065a6114fd91b474a1b4304de717372f88a7c02795787485706b |
|
MD5 | 9281d0602e83d30bc0a2d86014210f9b |
|
BLAKE2b-256 | 7c0bafe352dcf350cce146e1cb1dc798b4eb31a4be77b47db679ae81799b9771 |
Hashes for pylibrb-0.1.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8d9402dca1ac98c4333f23f38b9550a498435e8bd2ead2f4b28522158a2e18e |
|
MD5 | fcd77326289e079c8bd10045f53f7675 |
|
BLAKE2b-256 | 8a5524042dca9444b34122d47d0132f611e5b8110e461184633fde608241e630 |
Hashes for pylibrb-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a292e4842a1cbfae8650133d8d1db44aaff148581018eac854fa7d3ac668b6bd |
|
MD5 | c5a2e3597745cb6453594a3ff68d454b |
|
BLAKE2b-256 | d1265ccc3cc522f7731f5fcee92f7986f775fe7b1f9e2825704de2045582070e |
Hashes for pylibrb-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8015b78f422d187df9cba307e2aaa56264863f71206b95e934dbf2878b41c674 |
|
MD5 | 032dceef8f501c7624c7db311c95e0d8 |
|
BLAKE2b-256 | 85b73f0f8333607509afc98ae44c96ee53fa5e32b67f1bd2198bfaae12229fea |
Hashes for pylibrb-0.1.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edff91ad53f9a250f2443e269c3962cab0d204fba2660cb51860b28c31f85d46 |
|
MD5 | d26f1b3801569d8e23adfb7dd4af1992 |
|
BLAKE2b-256 | 93c0734fab864cf61b0f16b619a7fe17335427ad100b997d270acd5336cb8ff3 |
Hashes for pylibrb-0.1.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12de41a6e9840c3ec9cfbabe800bc3f1339a2cee98a09f2ba2aaded6f6e05b1d |
|
MD5 | 956a1dfdd013afec9bc0909a137fa413 |
|
BLAKE2b-256 | 0b5d4ca9ed35b7759b54bb761f26fcc4857513f1ac8b020ce66b8b94b23a9ea0 |
Hashes for pylibrb-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d5703e6ad5a57293b0bd270dcad458d2660d28152aa93f745a98051a0e3864 |
|
MD5 | 6243add552f632c5303324fd7ee1bb13 |
|
BLAKE2b-256 | bca67b85b9711517cfd9e94c24a191cf493fc3f8a217bde5d3e7f0038d5e6acd |
Hashes for pylibrb-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 116e1a94ea849fd95e568c52559491fe10dd7b6b6214727a05ad0f935de8eb67 |
|
MD5 | f280ca4ca9f8b37d1ccc2a00cbc4372c |
|
BLAKE2b-256 | 959bbc908ba767108135885d551cd3bcf759bfa3d91a6f3a2b1554049e97d8ec |
Hashes for pylibrb-0.1.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6baa4673dc388f758ef989c503326dc7984b31ae868cd7bc88d42886563e8e8e |
|
MD5 | 055ffac0111c906a95ef23428e7060c4 |
|
BLAKE2b-256 | 95541ffc264e02f32849ad01328b0a9143d590b1c5c1580edc8f0044e2cf652c |
Hashes for pylibrb-0.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfa0e0c55acb6015fe8cfee384b972bc5ec2283c19e21bac7fc497e6f0bed545 |
|
MD5 | 7e485d02e0ea887e4c8a84908bc496be |
|
BLAKE2b-256 | 3aab074e2e9d048dc55c5bf0114ad4be258eb93892cac67c7b97916af2fb5ee0 |
Hashes for pylibrb-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66341f478c546129b96ac748cf4a83eb76c1a73ee494ee305e116252eb5e436 |
|
MD5 | 6d8a8a7e2fe8d70def9dcfbc11e03d19 |
|
BLAKE2b-256 | 1b20a512ea78b19d9b476b0892a1102cc4be3865c1d377de3b14626e293dbd10 |
Hashes for pylibrb-0.1.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9217d060f30b4a9089a95fcc367c68fbb234906fcd3c97065e42933a339c08 |
|
MD5 | 0462972ffadaa96d091c7fa41bbe44db |
|
BLAKE2b-256 | 9f6acee6036ac753c073d3d0cede145e19587ffb005affcdf83b52752d9514f3 |
Hashes for pylibrb-0.1.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ebe0eb920ee26d9898789b2102f3798167c3bb22af98813f22cdfd85f44838 |
|
MD5 | 960e91d4b7cf728454e3294b9f676da8 |
|
BLAKE2b-256 | 5f2764e6250ea3f68abc924c3f2c963b40e64dcf77965cf1a2fc5544c120b72b |