Skip to main content

A performant audio capture pipeline that encodes raw PCM to Opus, skipping silence.

Project description

pcmflux

pcmflux is a high-performance audio capture and encoding module for Python.

It is designed to capture system audio using PulseAudio, encode it into the Opus format, and stream it with low latency. A key optimization is its ability to detect and discard silent audio chunks, significantly reducing network traffic and CPU usage during periods of no sound.

Prerequisites

This package compiles a C++ extension and requires the development headers for PulseAudio and Opus to be installed on your system.

On Debian/Ubuntu, you can install them with:

sudo apt-get install libpulse-dev libopus-dev

Core Features

  • PulseAudio Capture: Uses the pa_simple API for efficient, low-level audio capture.
  • Opus Encoding: Integrates the high-quality, low-latency Opus codec.
  • Silence Detection: Intelligently skips encoding and sending silent audio chunks.
  • Python ctypes Wrapper: Provides a clean and simple Python API over a high-performance C++ core.
  • Python Build System: Uses a robust Python build setup for compiling the C++ module and its dependencies.

Example Usage

The example directory contains a standalone demo that captures system audio, broadcasts it over a WebSocket, and plays it back in a web browser using the WebCodecs API.

To run the example:

  1. Install the module: pip3 install .
  2. Run the server: cd example && python3 audio_to_browser.py
  3. Open http://localhost:9001 in a modern web browser (Chrome, Edge, etc.).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcmflux-1.0.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pcmflux-1.0.4-cp313-cp313-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp313-cp313-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp313-cp313-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp313-cp313-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

pcmflux-1.0.4-cp312-cp312-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp312-cp312-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp312-cp312-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp312-cp312-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pcmflux-1.0.4-cp311-cp311-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp311-cp311-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp311-cp311-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp311-cp311-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pcmflux-1.0.4-cp310-cp310-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp310-cp310-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp310-cp310-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp310-cp310-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

pcmflux-1.0.4-cp39-cp39-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp39-cp39-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp39-cp39-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp39-cp39-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

pcmflux-1.0.4-cp38-cp38-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ x86-64

pcmflux-1.0.4-cp38-cp38-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ ARM64

pcmflux-1.0.4-cp38-cp38-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

pcmflux-1.0.4-cp38-cp38-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

File details

Details for the file pcmflux-1.0.4.tar.gz.

File metadata

  • Download URL: pcmflux-1.0.4.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pcmflux-1.0.4.tar.gz
Algorithm Hash digest
SHA256 88cb2b0c233b53600caa7afd45d31e2fef30eaf109c226642df5c6541b44a9d7
MD5 3777760236a43ca96cb70eeee891f33c
BLAKE2b-256 37bf4f36c1bb91bf3ca879a513be8fd3d02823465814b84f07ce92334463d7d6

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d9604b31be580d54a6538d848d4c5002bfcec19eaaea7e18ffadaa2de04b335f
MD5 12da360f1a3bb04afcd5b0f5458d00ad
BLAKE2b-256 d19dc56399b2c4f5f26d48396c713d76deb8b8142108dd9baaeb10a206fb8935

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8a750f7dd774123e91457e32f48fb0edf6dbefe4bf44a1042e4b59a413b3af8f
MD5 5f8cb22880cdad9fadc78e8e871146cd
BLAKE2b-256 ae6dff03cf81ca6546fde026910a5d4d6683b17bbcf284f8103028db0cb8d2cb

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 955bd701989b1cc302a8ccb6b0eea205b960731f8d910ef9b324afc26eda93ed
MD5 82c885d4299b1dbe8f51649d95978e6b
BLAKE2b-256 b182377734931bc47b3d923325255fb52ae552f535c57034717b131fcf5d788b

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 15001307ce4e15f7d51b1c30ee45d0123f05da99156df4d1865435fa316406d7
MD5 1b8458ec8967f7af793093a8303e9b69
BLAKE2b-256 0227014259a4f076b4e0c6e021a2be0662f17e38d3a37eb26d9adafa144aebd6

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 082eff9d0a93c18869757eb219c12d07c0f50345ef35de531958686b21048bbc
MD5 d56dc463c24f859f2fd71ac4b1ebffa5
BLAKE2b-256 859513bc5c915bd1549b396fb16c9b543387e149d73c73c6108b2522db001681

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4c4bcaba01c1586b9b68b47b8b6e62b4c9429ebcbc4a31df47aa601d51bf60ae
MD5 46943c741af562648197d1607d02be92
BLAKE2b-256 7da1b4d6f7a2993c67bd0f23463534a0f31bf3b1be8b406b11d8654e703f6127

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4bec47026b620ab75816949f650e7c8d4a3f8876a97112315d9084e3386009d1
MD5 63be38dc271bbb0ea21727cbbfcd130c
BLAKE2b-256 33dab4adf7dfba10122b3cf6561c84ca3a33230abd627570688ea9f659cb6356

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 580b95c97dea907ecf2b7d5bcb6efdaccc927c2706a2b083d423132042d8a4ba
MD5 56249fe23c782d443627efb5259398f9
BLAKE2b-256 d912cd92eea46f22b603aa53610b1e2a5b576304e26f30643501efed249883d1

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 53abe9636db02fff84a973c85c9acfd650d76405fbd6be7e67a3142465bd6df9
MD5 8cad02844de3f95801d9221cdd85152b
BLAKE2b-256 6434d7824278f4c0c79166aadc8009afa2dd2e6fed345a3062f529f7af673872

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp311-cp311-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e4d405bb58d5aa43fe581eabbc8bb4db415120113bf72b496870ba9513da0953
MD5 f7f5a75f05bf0a22258793a1cd4f0cf3
BLAKE2b-256 d803a155654327dee04e3ee2df194ef5e4e8cf192ef6c55d106e673d1bb4634d

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bc8081ffec0d5ea27b24a966cb97933c30b640b77a7fb3291555d983e707a528
MD5 776e6072eb0f6f823aa1b1f41762bf9d
BLAKE2b-256 c4e078041d46100347d1c7cd97de1415d88d962f6b5c3c5812d264e679974d97

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 72deb074524033cec42fe1bf45eacc16082e64bc13e8fb82fe18b2362926e4e5
MD5 f738ab5c77beb12929777d1f3aeb4ed5
BLAKE2b-256 57335566be25697f1d0cfe6d5aa9693aadc5af9cba0b2bc6ce3d88612e696853

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6087673e2cf077d7a3567a299d6dd7fa6115ef607ab8d1792df7048516585177
MD5 e8e793a3b6699472d65e897e8f378844
BLAKE2b-256 517c707c2c74d0ecd92b71c5ba7b6b261dae5e5f49139304f8bd4c8f66e1e1c2

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp310-cp310-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a78288ffeb02d12d04849654eba65d07b669a8cde2fca3f9c3701bc79aece1a1
MD5 ebe8e72f9cc295dd1d90e9c753fa2ef7
BLAKE2b-256 3db4506ce47747c017c7997cbc07ee20818b034b51013f0561f47a3ae1c594ca

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9dfae0dd1c14e349d77f70257f0b4fcade51876d7552eb3d40a6be3c0f4da1d5
MD5 898286314d3aae32e39b14ce0c9215b1
BLAKE2b-256 85d9d1697acf60537178c6d2370ffe3a0fb71452845263791f1425ff0425d463

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fe36515e32379a2f5ee2c20c15d1f9a8198e29f4117918d4ef862dfadd5133d6
MD5 92c0db1b726b16573ab843f53b6ec50b
BLAKE2b-256 9529429c5fe0e98418a80700ac3e3c1c603a599cb84638b13908ff78973e6edb

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 be307b0d313ede442838e2fcce124e708b8597982e7f537fcf37036b5a9c5f14
MD5 0a5530e26f33f20b88e0dde22c472d7f
BLAKE2b-256 f0e63a13866126d045eb60cce8637fa530e8e6ec31dd28c0f531182d901136a6

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp39-cp39-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fbb1b584cd100790433f1bf3be1d463faf33a5a3640f8fe61f419b72a8551629
MD5 b51306935aca28f9af9c7bff60c0f1dd
BLAKE2b-256 ce769ce11401472d29c91109185a6fe049d6ab87368d0982b698e246a3d11eea

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 39e3ea1a6b364e4ad176f735eb0582d7cee804d34d23b26a1899b8f8328d4936
MD5 61f26c209121627b79afcae23deb44d4
BLAKE2b-256 8df9a4323011e587854567b4c7654e6933f874aacc9b81684c8a09e6be1393db

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 74801c251a5f602b5dd08d34c736aa44c58e76766804e5d0b2fcb51da791f8a8
MD5 4e0f0b018e8dc43a6f4025d89d20c4c8
BLAKE2b-256 9e771fc0b9fc9b8b8617b3f56cfad63987dede6ed96480775ba6477d5d474b84

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9a180248cfc063444528b1c28fced695ff354142207ebfb58b64b25bacfbb991
MD5 6acafbe2d6beeffbdbc7e1c483fdc954
BLAKE2b-256 465d34976eefaf0ad06e5a16f5226349df8cc96cbeb669dc7d7b6d1e4927d572

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp38-cp38-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 856bf680f04a43a9d62fea934eb4118a81ff654e35bfe42ef9a94b5ecd9d6c34
MD5 ba7559d156a8cb84b6f4f5eab7110fcf
BLAKE2b-256 0d0f92ac6639953ee96a00e2c8ba8f45f640619d232a6a3460a943fb58d97fc5

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 809967fb88ffd5d5b95dee7ffdfd3950eb09a226748c37e625fd0b682ae1c68b
MD5 b4d95fdddd105f11623f4f7dbce1abf6
BLAKE2b-256 41629626287b8a80342be3179cd191ca1024dc381c43ccad41547df06c95fdbd

See more details on using hashes here.

File details

Details for the file pcmflux-1.0.4-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pcmflux-1.0.4-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cee413469ebf2b90f98fdae3401da05e53a1f773a74a369e18b157e77c1ea938
MD5 bbf096390e22117df16a78a90ea450cb
BLAKE2b-256 8011e68b4fecfc57b0f986264a587c80f5c83c2fbbcf39eabff0c2d18bddfafa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page