Reliable low-latency audio playback and recording
Project description
Goal: Reliable low-latency audio playback and recording with Python, using PortAudio via the sounddevice module.
The audio callback is implemented in C (and compiled with the help of CFFI) and doesn’t invoke the Python interpreter, therefore avoiding waiting for things like garbage collection and the GIL.
All PortAudio platforms and host APIs are supported. Runs on any Python version where CFFI is available.
Features:
playback of multiple signals at the same time (that’s why it’s called “mixer”)
play from buffer, play from ringbuffer
record into buffer, record into ringbuffer
multichannel support
NumPy arrays with data type 'float32' can be easily used (via the buffer protocol) as long as they are C-contiguous
fixed latency playback, (close to) no jitter (optional)
to be verified …
sample-accurate playback/recording (with known offset)
to be verified …
non-blocking callback function, using PortAudio ringbuffers
all memory allocations/deallocations happen outside the audio callback
Planned features:
meticulous reporting of overruns/underruns
loopback tests to verify correct operation and accurate latency values
fade in/out?
loop?
playlist/queue?
Out of scope:
reading from/writing to files (use e.g. the soundfile module)
realtime signal processing (inside the audio callback)
signal generators
multiple mixer instances (some PortAudio host APIs only support one stream at a time)
resampling (apart from what PortAudio does)
fast forward/rewind
panning/balance
audio/video synchronization
Somewhat similar projects:
Installation
On Windows, macOS, and Linux you can install a precompiled wheel with:
python3 -m pip install rtmixer
This will install rtmixer and its dependencies, including sounddevice.
Developers can install in editable mode with some variant of:
git clone https://github.com/spatialaudio/python-rtmixer cd python-rtmixer git submodule update --init python3 -m pip install -e .
Usage
See the list of examples on GitHub.
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 rtmixer-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03af4fe112a72dc8f242bc8cf311781448d26adf6cb0fe4bcfbd72a43344bc61 |
|
MD5 | ef851eef9bda05bf7d9a7e4464c8fd31 |
|
BLAKE2b-256 | 52a9100d0d6f50be9ad653e5c646fec3433356053872eb4a6478b195c8a35d82 |
Hashes for rtmixer-0.1.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2cf278da803e751562ff70c0207e1492511d16ce2d090366a448f7662ca817 |
|
MD5 | 09c59c5070f985ce5174738121af9099 |
|
BLAKE2b-256 | a36d47da632fa9cb713ef8471f687ce4bd468a579637f83d1c7def857eb4bc88 |
Hashes for rtmixer-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeed0862e057b2abb4cec7ad5f473293d6a4ad75f4be89f605dc714b4e2c4fe4 |
|
MD5 | ebeb135ae08bf0271f80ea40fe4d3b15 |
|
BLAKE2b-256 | 40bcb6d9def94067b08b1aecb90371bc8af4a2b2417b9592096e90a7c0afac9d |
Hashes for rtmixer-0.1.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d439b336cb044abd9249594aa6c318ab12fae69856bb72703fa0fed90b600425 |
|
MD5 | d6f565eea9c9a49794230c4a384393ee |
|
BLAKE2b-256 | d5de5a88fe5bcf241a1483706f87821864e5000853df8831e805fd4074f1c972 |
Hashes for rtmixer-0.1.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e812e9d0a178d98a849fb56f35417291caa27caf4a07e33699590d27b3199aa |
|
MD5 | 69cda3a79c0a1f005f7ab38a87febb24 |
|
BLAKE2b-256 | 19a8dea61b300f69e803f3416569dc033dbf713f5e2cc4817777bb5dd897dcbd |
Hashes for rtmixer-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0f79892c70d5d5cdec739b2743f9fd7edee020ef4ddf9529101cd173844ee7 |
|
MD5 | c0e77780a78fd9eaec73365c0d453ce7 |
|
BLAKE2b-256 | b0aa60745949ac73b91c63e9c8e98d8f00d378534e35d40bbb7504cbb12d8006 |
Hashes for rtmixer-0.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed2902987a83eba16525681eeb108be17e09ea16bd555e2b5637622682eb7ce |
|
MD5 | baec46bb43bd8727db3913bc58834a2d |
|
BLAKE2b-256 | 85249315c7d708e5c27eb2f4b153f5a91a6582919c70eb0de5246b671ebc44a1 |
Hashes for rtmixer-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c318fef7ea9fcb8eaaa7f575ee827ad1a59f8cd23a0ae25dec136ea72d80f49 |
|
MD5 | e0b5f5b381eac867aaab3137b06982e2 |
|
BLAKE2b-256 | 2a8ac59c34bb71b2e2d167566143032cc4ba8e82df625c0960fa57be86159058 |
Hashes for rtmixer-0.1.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4811b87d7ac9e64b8a43290e77975efffc0f354036f7df60de2968b7c34b163 |
|
MD5 | cafd6e4942a4973394406ff02706b31b |
|
BLAKE2b-256 | 3ffd69657c64f1a012c3a4aa49f6d22361aebf6da31e7ade07957fa15b6039dd |
Hashes for rtmixer-0.1.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e780a00bf46ae62b71d0def781f63f5556a66a502347cd90257550fe58ae85ec |
|
MD5 | dfa5471f58d71b53749c3bb16fd7b8f7 |
|
BLAKE2b-256 | 1d152140c5937acbd239db1cc63be3f034dfa34411bce006118073e59eeafe96 |
Hashes for rtmixer-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d7f21668c551f154fcb6f5ecf422cca50f97b75292fcdf4e55d06cd208b9d7 |
|
MD5 | ea13ec1dde040e05eca4f587593ad195 |
|
BLAKE2b-256 | 7301c5bbf06bd7155922b38c7fd95f5640466bcc4a97b63be5e2e4326979eef6 |
Hashes for rtmixer-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26cf5dd612d714fb57067acd0e733b20e133098e1808b7bfe78a8530e318e496 |
|
MD5 | 92950ef88f4fed97a18e51862381bc37 |
|
BLAKE2b-256 | 722c5a7560209f691b500d4a762332d9cb92d8e61b74f63e4611f02c60b2843b |
Hashes for rtmixer-0.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd107ecf3865ac78abdac93c827d4364dede15f7b7f013eb3c39a6422eb8aff |
|
MD5 | 0ac8548f2d0fb6bba8321c4ead3d2f62 |
|
BLAKE2b-256 | ed3816f6f21f4df5df37aa23275b6185d658724029eee3d80e4d027c58c5f9ad |
Hashes for rtmixer-0.1.0-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59976b81bd4b5fa7f178f4c2ca3961dc4f5e6b3c8631ad25f8920f57c150327a |
|
MD5 | 131fa5adb99af2b01d069362ea178050 |
|
BLAKE2b-256 | 306fe634993bdf34e1fcc06b9ac1a0f57920ab66ece87e3b592c7a8d347ef821 |
Hashes for rtmixer-0.1.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b5f5d8c46f70b1ed47d194b877e31b8e27908db349e323ca56d898fce8d1bf |
|
MD5 | 56b99bf622163dbcf222dfedda3475a3 |
|
BLAKE2b-256 | 3e3f039c81c7fd28ad1ffdc5250ca28ea6be9d515f7a600ee516ab1e39043276 |