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.5.tar.gz (9.4 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.5-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.5-cp313-cp313-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-cp313-cp313-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

pcmflux-1.0.5-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.5-cp312-cp312-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-cp312-cp312-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pcmflux-1.0.5-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.5-cp311-cp311-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-cp311-cp311-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pcmflux-1.0.5-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.5-cp310-cp310-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-cp310-cp310-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

pcmflux-1.0.5-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.5-cp39-cp39-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-cp39-cp39-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

pcmflux-1.0.5-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.5-cp38-cp38-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ ARM64

pcmflux-1.0.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: pcmflux-1.0.5.tar.gz
  • Upload date:
  • Size: 9.4 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.5.tar.gz
Algorithm Hash digest
SHA256 b35b3eac8b9fcc2cac71ab3aa5000e6502b80cef29dde8386f727820bd40bb27
MD5 bd7dafa52a9a59e5f900292e6931ee2c
BLAKE2b-256 dd723bfaad60f59f1e248575add235c30d61a5b8317f307c30d3c3d73ef5dfea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a4ffaa3a958e82d40bc663f5a36373cc645a5c7470620eace57849af4ffaed21
MD5 83a65fea100f400e877aacd6b879c1ea
BLAKE2b-256 c4aa3953bf77063fdae9943c81efde0ad9a13cabbdb789278cdd09f022b89e5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 39e375dd3e314a50047bea751d6200bcd42392668edbc8e8ddbfd86e8d797b53
MD5 a48a67863e32d8e587e2c5e0181c2e5a
BLAKE2b-256 500b6f4d48fb1167e94f50694e8e544d3a8ce9606535d5631357884f84eecbae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8049299b9ab97a3ea78a653b2b0dca2fb31f78adc8deab0d1dc1c779288d1b6e
MD5 f5e4a4b0626f2fa109c1f3859afbb145
BLAKE2b-256 0bc2f02029118ecc5a72fc8785e14ecec4a710a14eb0aab9f52e7d30a52e4771

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f6dd0436d0c81cd0e37459c9a47cabc1d52d1ab9e197b32da84137717d3fa957
MD5 9e20f92778baacdcf6291f0804bc6671
BLAKE2b-256 5eaa53e6d95626b18f98a0304b6bc7d1b74bd9d72165a478977fce5dab2eb6b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a3245cedd97501a9b22bab007ebbb7ff6e7efc2656cea4dcaa6c37b21e15faba
MD5 8ec458a04745abb38da49ee61f96f90f
BLAKE2b-256 ccf4186a02027142d162f274989c9511f009ac81c257a585c9c1e1a65c08f566

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 050667da4e44ff170b50f5ccc9d8ad1cd40075e994adda2760ccff46b47e1e51
MD5 246edadd8b1196b0bf9e6aed44d5f735
BLAKE2b-256 679908b44f8098d25dd1a803be9c63c0ff53d8604a75d3f50eb1f52ec0827614

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a1fae23b3bfa738cf52a31ba26c15afa53f612967f7717816965eb6cdb573c31
MD5 5529f62f98086e65e172f09334e9ca89
BLAKE2b-256 e522c9ab36be0510013a1fb2a44f7fa1a0716bc01868a65d9670ca5e1bd8f35f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 623bbf84189fdf7d592099b2ef388f7609efd5bcf23dc909c8d2c71d67976c7f
MD5 b514d00b3a773c591e31775748cc2244
BLAKE2b-256 e8a18a56ce1dee983bbf63828c9c6df7f40c568dcf9366c4a7aa1745d18cb040

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e2e6b906e137db0f34f99856c8f43e6c2e6432f1ac4ea05e97e0e8f994f3ccec
MD5 7a4815405ddae64eddfd903511289128
BLAKE2b-256 2bbd5862c2f37c9dcc655d7049b4f34e2fa028adb8b5d24fd643a134fed17ac8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 442507aac0796e01433e29e63f4ff513b80580fb7056141fd5e6b48e766a6f4d
MD5 e133790635905b745df2d35bccbdd6c2
BLAKE2b-256 00bd510c98507ae3d997828339f752969e0420155436f9d5ab5fc48d7e49fd35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aa863aa6b4c560e1517fbb8f79389b3548bdf510a0091e2cec92ef1776154043
MD5 4eb683e890ca9b15b1a8e53188aed1ad
BLAKE2b-256 323a9144dc4f2bb60cd2aee717d64b034049e4e04f2783114097c12e79133e7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 11b9728d6ce772f1118cab07d42697dac7300352c97b60e6b43d4c0dbce67d83
MD5 5001bc931a8aeabbdc075df459e978c0
BLAKE2b-256 68bdd6c960a7458502f40348eed810a1c06f783097f4cce9b0e3dee4d4727572

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bdeeec619e0f9653c11e770ea5c58168e3b3d02c4a9e93338f2ce54c3591301e
MD5 a4df793d53998f6dc2e6adb3f6310ce0
BLAKE2b-256 3207a3fb2913fbcbb8f62ff9fd7d249d5b13496725b98fb95742842463bf01c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e9e3a830239f22b495f44c99506f8ab711a1b11780b94deea48819c74f498843
MD5 06abf92e62607ade0f36452676c155fb
BLAKE2b-256 4389a4ddaeb458861206194aa1e316ecc8f392ee18840811c3960bc413d4a3c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0336d29924bb6768474fc14786994ac94954261b285552d13cd25edf07b0ac2
MD5 cce6fd2d0dddabd7a524e5b771531155
BLAKE2b-256 d6f4320aba4e46902dc08af742babf03c4301d93d62856017e1e313d8c2a6a3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1e673587ff8af0e766ecb679167d1848a9e1537fec6449638498f259b2e7c3ff
MD5 153092262d8635e2a2f77797c695e523
BLAKE2b-256 8768ca39018caacd2fdfbe839159017e611bbd157f7d80da2baccdd7537df277

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 745396e9ff7f9b15c9748da177d7da3bfeba369e7f49322dbe47a283b367051b
MD5 84ecc45b3c585913015820bb76a94dac
BLAKE2b-256 8975e686e9033aa268b11b0117d559c0f0c8e4496c098c5f82a3521e50840845

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 204826b3caa929d48ec4259653e38360907d630a8724247a15c550f85171de7f
MD5 61606669cf86d0b8ad1e346306c73ee6
BLAKE2b-256 1474206b1eccac0fad84a56b16caf6bae92d6b01515adac75911e5519011c571

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 abc0c6cb35dab49d63709e087ece35ba066aed1f37b3555eaf56f32ee5380f7c
MD5 755940195aea830145bce265014b99d9
BLAKE2b-256 07cb477adcfc9a69cdcb8069883c4eaba8aa953d4f0e98e033ccd66ad912c9af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9fbb3cfc019929c8fa1561f6b8d92c7136351665b680b161b561c6d25bdef250
MD5 bcf6dc6e4e742cf8ee25e55bdb88126a
BLAKE2b-256 42ce463fdc8263df46943e14760705dc284887a868cb321b2b39dd4c677993aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7d718ea6ddded9ec0d0de5f2925de7b8518b1fd4a34e7d42fe08d165f181baf5
MD5 59ddc7a476eb0f365b6f22b9e092882f
BLAKE2b-256 e011f2239315a8976f70e4a52471679a30ec07c697fb98ce3fcb8956b7269085

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f92b09cd900cf639b87f5e408fff8909aa16a1deb3d87894aadbe9c5ae3f2332
MD5 0b06924b733711eabe37dcecfe25a83c
BLAKE2b-256 237f4494fda235e04b580e158f4fea078a456e3af4c24ba61c6fb34faf1e7484

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2798dfb02593c26ac881e0e44ff6eca41730cfcd1d2398ec2ee3c6e39300d343
MD5 2622e67451f1bfe88f3804cce186561e
BLAKE2b-256 898966c2ab9f7d520aae09624e22593194d07a952e02bf4656ea887d4b261394

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pcmflux-1.0.5-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fb6ad7ebef1d015f27c4d9c905340cc5af7720dc362775dc1c01cf4822e4a082
MD5 5001446d0bd62a9544fd7e60fdc6e665
BLAKE2b-256 74639f850a0c379e6a4d474e9468d742895d7ddc9be4ecb11687d92245d3d978

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