flexaudio 0.5.3__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flexaudio-0.5.3 → flexaudio-0.6.0}/Cargo.lock +13 -13
- {flexaudio-0.5.3 → flexaudio-0.6.0}/Cargo.toml +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/PKG-INFO +44 -74
- {flexaudio-0.5.3 → flexaudio-0.6.0}/README.md +43 -73
- {flexaudio-0.5.3 → flexaudio-0.6.0}/THIRD_PARTY_NOTICES.md +99 -99
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/README.md +43 -73
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/THIRD_PARTY_NOTICES.md +99 -99
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/flexaudio.pyi +133 -99
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/config.rs +34 -116
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/errors.rs +120 -17
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/lib.rs +12 -38
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/marshal.rs +34 -110
- flexaudio-0.5.3/bindings/flexaudio-py/src/whisper_buffer.rs → flexaudio-0.6.0/bindings/flexaudio-py/src/pcm_buffer.rs +2 -2
- flexaudio-0.6.0/bindings/flexaudio-py/src/stream.rs +827 -0
- flexaudio-0.6.0/bindings/flexaudio-py/src/stream_stop.rs +212 -0
- flexaudio-0.5.3/bindings/flexaudio-py/src/stream_whisper.rs → flexaudio-0.6.0/bindings/flexaudio-py/src/stream_vad.rs +106 -117
- flexaudio-0.5.3/bindings/flexaudio-py/src/whisper_vad.rs → flexaudio-0.6.0/bindings/flexaudio-py/src/vad.rs +137 -116
- flexaudio-0.5.3/bindings/flexaudio-py/src/whisper_marshal.rs → flexaudio-0.6.0/bindings/flexaudio-py/src/vad_marshal.rs +16 -22
- flexaudio-0.5.3/bindings/flexaudio-py/tests/rust/whisper_vad.rs → flexaudio-0.6.0/bindings/flexaudio-py/tests/rust/vad.rs +43 -27
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/tests/test_contracts.py +44 -10
- flexaudio-0.5.3/bindings/flexaudio-py/tests/test_whisper_buffer.py → flexaudio-0.6.0/bindings/flexaudio-py/tests/test_pcm_buffer.py +10 -10
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/tests/test_startup_documentation.py +1 -9
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/Cargo.toml +6 -6
- flexaudio-0.6.0/crates/flexaudio/THIRD_PARTY_NOTICES.md +1368 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/device_watcher.rs +4 -4
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/lib.rs +46 -36
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/child.rs +3 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/contract_tests.rs +0 -20
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/notices.rs +70 -7
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/repro_tests.rs +20 -20
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/tests.rs +25 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix.rs +0 -11
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/intake.rs +4 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/intake_generation.rs +33 -6
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/permission_tests.rs +2 -2
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/repro_tests.rs +32 -32
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/shared.rs +7 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/source.rs +1 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/startup_tests.rs +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream.rs +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream_frame_tests.rs +100 -0
- flexaudio-0.6.0/crates/flexaudio-core/src/addon_error.rs +78 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/clock.rs +20 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/diagnostics.rs +25 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/error_context.rs +27 -31
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/errors.rs +55 -11
- flexaudio-0.6.0/crates/flexaudio-core/src/inventory.rs +330 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/lib.rs +8 -2
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/output.rs +20 -5
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/repro_tests.rs +25 -21
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer.rs +1 -1
- flexaudio-0.6.0/crates/flexaudio-core/src/spawn_error.rs +29 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/types.rs +40 -17
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/types_tests.rs +2 -0
- flexaudio-0.5.3/crates/flexaudio-core/src/whisper_error.rs → flexaudio-0.6.0/crates/flexaudio-core/src/vad_error.rs +7 -3
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/Cargo.toml +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/src/error.rs +17 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/Cargo.toml +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/callback_mailbox.rs +18 -3
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/input_config.rs +89 -4
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/lib.rs +82 -69
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/tests.rs +56 -3
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/Cargo.toml +1 -1
- flexaudio-0.6.0/crates/flexaudio-os-linux/src/capture_failures.rs +213 -0
- flexaudio-0.6.0/crates/flexaudio-os-linux/src/discovery.rs +196 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/src/lib.rs +478 -321
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/src/owner.rs +0 -13
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/src/processes.rs +209 -59
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/src/readiness.rs +28 -11
- flexaudio-0.6.0/crates/flexaudio-os-linux/src/watcher_failures.rs +51 -0
- flexaudio-0.6.0/crates/flexaudio-os-linux/src/watcher_queue.rs +136 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/Cargo.toml +1 -1
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/common.rs +43 -17
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/devices.rs +145 -75
- flexaudio-0.6.0/crates/flexaudio-os-macos/src/inventory.rs +157 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/lib.rs +3 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/native_probe/capture.rs +7 -4
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/native_probe/io.rs +17 -3
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/native_probe.rs +2 -7
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/probe/tests.rs +119 -13
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/probe.rs +100 -5
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/process.rs +30 -14
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/processes.rs +73 -37
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/system.rs +60 -39
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/tap.rs +3 -3
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/Cargo.toml +2 -2
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/common.rs +72 -14
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/format.rs +36 -0
- flexaudio-0.6.0/crates/flexaudio-os-windows/src/inventory.rs +138 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/lib.rs +6 -0
- flexaudio-0.6.0/crates/flexaudio-os-windows/src/native_outcomes.rs +243 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/process.rs +13 -13
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/processes.rs +111 -90
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/system.rs +162 -97
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/Cargo.toml +2 -2
- flexaudio-0.6.0/crates/flexaudio-vad/README.md +61 -0
- flexaudio-0.6.0/crates/flexaudio-vad/THIRD_PARTY_NOTICES.md +2804 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/examples/dump_probs.rs +10 -25
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/examples/probe.rs +4 -3
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_capture.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/capture_converter.rs +17 -11
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_capture_tests.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/capture_converter_tests.rs +8 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/src/infer.rs +43 -44
- flexaudio-0.6.0/crates/flexaudio-vad/src/input_converter.rs +137 -0
- flexaudio-0.6.0/crates/flexaudio-vad/src/lib.rs +116 -0
- flexaudio-0.6.0/crates/flexaudio-vad/src/params.rs +191 -0
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_preview.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/preview.rs +2 -2
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/src/resample.rs +24 -50
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_stream.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/stream.rs +192 -55
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_stream_tests.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/stream_tests.rs +139 -35
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_tap.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/tap.rs +40 -29
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_tap_tests.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/tap_tests.rs +46 -29
- flexaudio-0.6.0/crates/flexaudio-vad/src/tap_types.rs +189 -0
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_types.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/types.rs +89 -28
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_postprocess.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/whisper_cpp_segments.rs +23 -26
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_postprocess_tests.rs → flexaudio-0.6.0/crates/flexaudio-vad/src/whisper_cpp_segments_tests.rs +92 -68
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/speech_fixture.rs +73 -49
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/whisper_golden.rs +19 -11
- {flexaudio-0.5.3 → flexaudio-0.6.0}/pyproject.toml +1 -1
- flexaudio-0.5.3/bindings/flexaudio-py/src/stream.rs +0 -1333
- flexaudio-0.5.3/bindings/flexaudio-py/src/stream_stop.rs +0 -548
- flexaudio-0.5.3/bindings/flexaudio-py/src/vad.rs +0 -145
- flexaudio-0.5.3/crates/flexaudio/THIRD_PARTY_NOTICES.md +0 -345
- flexaudio-0.5.3/crates/flexaudio-os-linux/src/discovery.rs +0 -29
- flexaudio-0.5.3/crates/flexaudio-os-linux/src/watcher_queue.rs +0 -63
- flexaudio-0.5.3/crates/flexaudio-vad/README.md +0 -66
- flexaudio-0.5.3/crates/flexaudio-vad/THIRD_PARTY_NOTICES.md +0 -345
- flexaudio-0.5.3/crates/flexaudio-vad/src/capture.rs +0 -193
- flexaudio-0.5.3/crates/flexaudio-vad/src/config.rs +0 -130
- flexaudio-0.5.3/crates/flexaudio-vad/src/lib.rs +0 -1214
- flexaudio-0.5.3/crates/flexaudio-vad/src/segmenter.rs +0 -197
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_params.rs +0 -187
- flexaudio-0.5.3/crates/flexaudio-vad/src/whisper_tap_types.rs +0 -130
- {flexaudio-0.5.3 → flexaudio-0.6.0}/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/Cargo.toml +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/denoise.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/encode.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/src/watcher.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/bindings/flexaudio-py/tests/test_exclude_pids.py +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/drift.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/permission_tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/startup_tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mix/worker.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/mock.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/processes.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/contract_tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/control.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/delivery.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/lifecycle.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/processor.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/recovery_tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/startup_order.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tap_drain.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/terminal.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests/gain.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests/health.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests/output.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests/pause.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests/validation.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/src/stream/tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/tests/integration.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio/tests/processes_linux.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/Cargo.toml +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/backend.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/chunk_ring.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/loss.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/resampler.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/tests/clock.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/tests/conversion.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/tests/processor.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/normalizer/tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/process_list.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/quant.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/raw_ring.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/secondary_ring.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-core/src/startup.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-denoise/Cargo.toml +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-denoise/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-denoise/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-denoise/src/lib.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/src/lib.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/src/writer.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-encode/tests/roundtrip.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/capture_owner/tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/capture_owner.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/mac_permission.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/mac_policy/tests.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/mac_policy.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/permission.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/windows_keeper.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/windows_permission.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/src/windows_policy.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-mic/tests/windows_cpal_keeper.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-linux/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/activity.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/capture_health.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/native_probe/output.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/owner.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/probe_signal.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/tap/buffer.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/terminal.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-macos/src/version.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/README.md +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/keepalive.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/lifecycle.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/owner.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-os-windows/src/version.rs +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/LICENSE +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/assets/silero_vad_openvino_16k.onnx +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/fixtures/jp_2spk_FF_4s_16k.probs.txt +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/fixtures/jp_2spk_FF_4s_16k.wav +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/fixtures/whisper_vad_golden.json +0 -0
- {flexaudio-0.5.3 → flexaudio-0.6.0}/crates/flexaudio-vad/tests/fixtures/whisper_vad_golden_extreme.json.gz +0 -0
|
@@ -722,7 +722,7 @@ dependencies = [
|
|
|
722
722
|
|
|
723
723
|
[[package]]
|
|
724
724
|
name = "flexaudio"
|
|
725
|
-
version = "0.
|
|
725
|
+
version = "0.6.0"
|
|
726
726
|
dependencies = [
|
|
727
727
|
"flexaudio-core",
|
|
728
728
|
"flexaudio-denoise",
|
|
@@ -734,7 +734,7 @@ dependencies = [
|
|
|
734
734
|
|
|
735
735
|
[[package]]
|
|
736
736
|
name = "flexaudio-cli"
|
|
737
|
-
version = "0.
|
|
737
|
+
version = "0.6.0"
|
|
738
738
|
dependencies = [
|
|
739
739
|
"clap",
|
|
740
740
|
"ctrlc",
|
|
@@ -746,7 +746,7 @@ dependencies = [
|
|
|
746
746
|
|
|
747
747
|
[[package]]
|
|
748
748
|
name = "flexaudio-core"
|
|
749
|
-
version = "0.
|
|
749
|
+
version = "0.6.0"
|
|
750
750
|
dependencies = [
|
|
751
751
|
"bitflags 2.13.0",
|
|
752
752
|
"ringbuf",
|
|
@@ -757,14 +757,14 @@ dependencies = [
|
|
|
757
757
|
|
|
758
758
|
[[package]]
|
|
759
759
|
name = "flexaudio-denoise"
|
|
760
|
-
version = "0.
|
|
760
|
+
version = "0.6.0"
|
|
761
761
|
dependencies = [
|
|
762
762
|
"nnnoiseless",
|
|
763
763
|
]
|
|
764
764
|
|
|
765
765
|
[[package]]
|
|
766
766
|
name = "flexaudio-encode"
|
|
767
|
-
version = "0.
|
|
767
|
+
version = "0.6.0"
|
|
768
768
|
dependencies = [
|
|
769
769
|
"claxon",
|
|
770
770
|
"flacenc",
|
|
@@ -774,7 +774,7 @@ dependencies = [
|
|
|
774
774
|
|
|
775
775
|
[[package]]
|
|
776
776
|
name = "flexaudio-ffi"
|
|
777
|
-
version = "0.
|
|
777
|
+
version = "0.6.0"
|
|
778
778
|
dependencies = [
|
|
779
779
|
"flexaudio",
|
|
780
780
|
"flexaudio-denoise",
|
|
@@ -784,7 +784,7 @@ dependencies = [
|
|
|
784
784
|
|
|
785
785
|
[[package]]
|
|
786
786
|
name = "flexaudio-mic"
|
|
787
|
-
version = "0.
|
|
787
|
+
version = "0.6.0"
|
|
788
788
|
dependencies = [
|
|
789
789
|
"block2",
|
|
790
790
|
"cpal",
|
|
@@ -796,7 +796,7 @@ dependencies = [
|
|
|
796
796
|
|
|
797
797
|
[[package]]
|
|
798
798
|
name = "flexaudio-napi"
|
|
799
|
-
version = "0.
|
|
799
|
+
version = "0.6.0"
|
|
800
800
|
dependencies = [
|
|
801
801
|
"flexaudio",
|
|
802
802
|
"flexaudio-denoise",
|
|
@@ -809,7 +809,7 @@ dependencies = [
|
|
|
809
809
|
|
|
810
810
|
[[package]]
|
|
811
811
|
name = "flexaudio-os-linux"
|
|
812
|
-
version = "0.
|
|
812
|
+
version = "0.6.0"
|
|
813
813
|
dependencies = [
|
|
814
814
|
"flexaudio-core",
|
|
815
815
|
"pipewire",
|
|
@@ -817,7 +817,7 @@ dependencies = [
|
|
|
817
817
|
|
|
818
818
|
[[package]]
|
|
819
819
|
name = "flexaudio-os-macos"
|
|
820
|
-
version = "0.
|
|
820
|
+
version = "0.6.0"
|
|
821
821
|
dependencies = [
|
|
822
822
|
"block2",
|
|
823
823
|
"flexaudio-core",
|
|
@@ -831,7 +831,7 @@ dependencies = [
|
|
|
831
831
|
|
|
832
832
|
[[package]]
|
|
833
833
|
name = "flexaudio-os-windows"
|
|
834
|
-
version = "0.
|
|
834
|
+
version = "0.6.0"
|
|
835
835
|
dependencies = [
|
|
836
836
|
"flexaudio-core",
|
|
837
837
|
"windows",
|
|
@@ -839,7 +839,7 @@ dependencies = [
|
|
|
839
839
|
|
|
840
840
|
[[package]]
|
|
841
841
|
name = "flexaudio-py"
|
|
842
|
-
version = "0.
|
|
842
|
+
version = "0.6.0"
|
|
843
843
|
dependencies = [
|
|
844
844
|
"flexaudio",
|
|
845
845
|
"flexaudio-denoise",
|
|
@@ -850,7 +850,7 @@ dependencies = [
|
|
|
850
850
|
|
|
851
851
|
[[package]]
|
|
852
852
|
name = "flexaudio-vad"
|
|
853
|
-
version = "0.
|
|
853
|
+
version = "0.6.0"
|
|
854
854
|
dependencies = [
|
|
855
855
|
"flate2",
|
|
856
856
|
"flexaudio-core",
|
|
@@ -3,7 +3,7 @@ resolver = "2"
|
|
|
3
3
|
members = ["crates/flexaudio-core", "crates/flexaudio-os-windows", "crates/flexaudio-os-macos", "crates/flexaudio-os-linux", "crates/flexaudio-mic", "crates/flexaudio", "crates/flexaudio-vad", "crates/flexaudio-encode", "crates/flexaudio-denoise", "bindings/flexaudio-py"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.
|
|
6
|
+
version = "0.6.0"
|
|
7
7
|
edition = "2021"
|
|
8
8
|
license = "MIT"
|
|
9
9
|
rust-version = "1.85"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flexaudio
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Topic :: Multimedia :: Sound/Audio :: Capture/Recording
|
|
@@ -23,7 +23,7 @@ per-process loopback) written in Rust. Built with PyO3 and maturin.
|
|
|
23
23
|
## Install
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
pip install "flexaudio>=0.
|
|
26
|
+
pip install "flexaudio>=0.6,<0.7"
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
@@ -142,56 +142,22 @@ Platform behavior:
|
|
|
142
142
|
- Linux matches exact PIDs, without excluding descendants. Linux and Windows
|
|
143
143
|
ignore the selected system device while exclusion is active.
|
|
144
144
|
|
|
145
|
-
###
|
|
145
|
+
### Noise suppression and attached VAD
|
|
146
146
|
|
|
147
|
-
`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
queues the actual 480-frame (10 ms) denoiser tail and pending VAD boundaries;
|
|
152
|
-
continue polling after stop to receive them. Repeated stop does not repeat tails.
|
|
153
|
-
Capture terminal failure suppresses remaining PCM and audio tails.
|
|
147
|
+
`denoise=True` enables RNNoise. Without VAD it processes delivered PCM during
|
|
148
|
+
polling; with VAD it processes the shared capture branch before VAD and output
|
|
149
|
+
conversion. It requires 48000 Hz output and introduces 480 samples/channel of delay.
|
|
150
|
+
Graceful stop queues the denoiser tail; continue polling to receive final output.
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
samples = np.frombuffer(chunk.data, dtype=np.float32) # denoised audio
|
|
161
|
-
for ev in chunk.vad_events: # speech boundaries
|
|
162
|
-
print(ev.type, ev.at_sample) # "speech_start"/"speech_end"
|
|
163
|
-
```
|
|
152
|
+
Attach the same generic VAD engine with
|
|
153
|
+
`vad=flexaudio.StreamVadOptions(provisional=True)`. Each chunk's `vad_events`
|
|
154
|
+
contains ordered segments, optional provisional hints, and epoch markers.
|
|
155
|
+
The fixed 20 ms chunk size preserves canonical capture conversion and ordering;
|
|
156
|
+
other chunk durations are rejected before opening a device.
|
|
164
157
|
|
|
165
|
-
`
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
standalone `Vad` (below). `at_sample` is measured at the VAD's internal rate
|
|
169
|
-
(16000 or 8000 Hz), not the input rate.
|
|
170
|
-
|
|
171
|
-
VAD emits `speech_start` and `speech_end` together when a segment is finalized,
|
|
172
|
-
not when speech first begins. On `DISCONTINUITY` (`chunk.flags & 1`), an open
|
|
173
|
-
pre-gap segment is flushed before the post-gap PCM is processed. Flushed events
|
|
174
|
-
come first and retain their pre-gap `at_sample` values; VAD then restarts its
|
|
175
|
-
sample clock at zero. These positions are separate from `chunk.pts_ns`.
|
|
176
|
-
|
|
177
|
-
Consumers distinguish timelines by the discontinuity chunk: the core always
|
|
178
|
-
delivers 20 ms chunks, which cannot complete a fresh 32 ms VAD inference frame.
|
|
179
|
-
Consequently **all events on the discontinuity chunk belong to the pre-gap
|
|
180
|
-
timeline**, and all events on subsequent chunks belong to the new timeline.
|
|
181
|
-
Handle that chunk's events under the previous timeline before advancing your
|
|
182
|
-
VAD timeline; the chunk's PCM itself already belongs to the post-gap timeline.
|
|
183
|
-
For example, a flushed pair at 0/512 on the discontinuity chunk is old; a pair
|
|
184
|
-
at 0/1024 delivered later is new. Do not infer the boundary from a decrease in
|
|
185
|
-
`at_sample`: delayed post-gap speech need not produce one. A mixed event list
|
|
186
|
-
from larger chunks would require an explicit flushed-event count or timeline
|
|
187
|
-
identifier; larger chunks are not supported by the current core.
|
|
188
|
-
|
|
189
|
-
If the discontinuity flush fails, VAD reset is still attempted and denoise is
|
|
190
|
-
still reset before `poll_chunk()` raises the flush error through its existing
|
|
191
|
-
exception path. That poll consumes the chunk. When reset succeeds, later
|
|
192
|
-
chunks process normally without repeating that flush error. If VAD reset
|
|
193
|
-
itself fails, its failure remains latched and subsequent processing reports
|
|
194
|
-
it until a reset succeeds.
|
|
158
|
+
On macOS, `silence_probe=False` disables the silence diagnosis tone. The default
|
|
159
|
+
is enabled: after five seconds of exact-zero system capture, a 1 kHz tone at
|
|
160
|
+
amplitude 1e-5 plays for 300 ms to help distinguish permission failure from silence.
|
|
195
161
|
|
|
196
162
|
### Standalone add-ons
|
|
197
163
|
|
|
@@ -199,9 +165,9 @@ The same building blocks are available as independent classes.
|
|
|
199
165
|
|
|
200
166
|
```python
|
|
201
167
|
# Voice activity detection over arbitrary-format PCM (mono/stereo, any rate).
|
|
202
|
-
vad = flexaudio.Vad(threshold=0.5, min_silence_ms=100)
|
|
168
|
+
vad = flexaudio.Vad(threshold=0.5, min_silence_ms=100)
|
|
203
169
|
for ev in vad.process(samples, input_sample_rate=48000, input_channels=2):
|
|
204
|
-
print(ev.type
|
|
170
|
+
print(ev.type)
|
|
205
171
|
|
|
206
172
|
# Noise suppression (48 kHz, +/-1.0 normalized interleaved f32).
|
|
207
173
|
den = flexaudio.Denoiser(channels=1)
|
|
@@ -246,9 +212,8 @@ path, reason, optional positive scalar-interleaved sample count, rate, and chann
|
|
|
246
212
|
exact chunk attribution; flags 8 (`PADDED`) and 16 (`CLIPPED`) instead describe
|
|
247
213
|
that delivered chunk. Padding alone does not imply a gap.
|
|
248
214
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
and compatibility. From 0.5.3, macOS microphone capture requires decided consent
|
|
215
|
+
`permissionPending` remains available for custom Rust backends; built-in sources
|
|
216
|
+
do not emit it. From 0.5.3, macOS microphone capture requires decided consent
|
|
252
217
|
before each start and does not continuously monitor authorization or revocation.
|
|
253
218
|
`error` and `terminalError` are terminal; `recoverableError` continues
|
|
254
219
|
capture. `terminal_error()` retains the typed capture primary. `shutdown_report()`
|
|
@@ -274,11 +239,15 @@ their models/tables and require no runtime files or network access:
|
|
|
274
239
|
- **flexaudio-denoise** — uses [nnnoiseless](https://github.com/jneem/nnnoiseless)
|
|
275
240
|
(BSD-3-Clause), a Rust port of RNNoise with embedded model weights.
|
|
276
241
|
|
|
277
|
-
###
|
|
242
|
+
### Generic VAD
|
|
278
243
|
|
|
279
|
-
`
|
|
244
|
+
`Vad` runs embedded Silero v6 on normalized float32, with
|
|
280
245
|
segmentation matching whisper.cpp pin `85a69493a601d4ff5a834064f7b7bac250bd8739`.
|
|
281
|
-
|
|
246
|
+
`process(samples, input_sample_rate=16000, input_channels=1)` accepts arbitrary
|
|
247
|
+
positive input rates/channel counts and converts to mono16k internally. Event
|
|
248
|
+
times use the input timeline, compensated for converter group delay. After raw
|
|
249
|
+
input validation, finite resampler overshoot is clipped internally to [-1, 1]. It accepts
|
|
250
|
+
a sequence or a contiguous one-dimensional native float32 buffer;
|
|
282
251
|
NumPy is optional. Buffer input is copied through Python bytes into owned Rust
|
|
283
252
|
float32 storage for Python 3.8 stable-ABI compatibility, and sequence input is
|
|
284
253
|
copied for that feed. Instances stay on their creating thread.
|
|
@@ -287,7 +256,7 @@ copied for that feed. Instances stay on their creating thread.
|
|
|
287
256
|
import array
|
|
288
257
|
import flexaudio
|
|
289
258
|
|
|
290
|
-
vad = flexaudio.
|
|
259
|
+
vad = flexaudio.Vad(provisional=True)
|
|
291
260
|
events = vad.process(memoryview(array.array('f', [0.0] * 513)))
|
|
292
261
|
events += vad.finish()
|
|
293
262
|
for event in events:
|
|
@@ -295,11 +264,14 @@ for event in events:
|
|
|
295
264
|
print(event.start_ms, event.end_ms)
|
|
296
265
|
```
|
|
297
266
|
|
|
298
|
-
Parameters are `threshold=0.5`, `
|
|
299
|
-
`
|
|
267
|
+
Parameters are `threshold=0.5`, `min_speech_ms=250`,
|
|
268
|
+
`min_silence_ms=100`, `max_speech_ms=0`, and
|
|
300
269
|
`speech_pad_ms=30`. Supplied zero values stay zero. Durations must be integers
|
|
301
270
|
in 0..134217; bool durations, unknown keys, invalid PCM and nonfinite parameters
|
|
302
|
-
are rejected.
|
|
271
|
+
are rejected. `max_speech_ms` is integer milliseconds; 0 or values above 100000000 use the
|
|
272
|
+
effectively unbounded legacy `INT_MAX/2`-sample sentinel (1073741823 samples). Other positive
|
|
273
|
+
values below one inference frame plus twice the padding budget are rejected; equality
|
|
274
|
+
(a zero split budget) is valid. Fixed
|
|
303
275
|
200 ms merging can undo splits: it does **not** bound final segment duration or
|
|
304
276
|
latency. Optional provisional cuts independently cap pieces at 30000 ms.
|
|
305
277
|
|
|
@@ -309,31 +281,29 @@ Events are read-only variant objects with snake_case fields and type tags:
|
|
|
309
281
|
final endpoints use the 10 ms grid and can exceed physical EOF. `finish()`
|
|
310
282
|
infers one zero-padded partial frame when needed, closes the epoch, and is
|
|
311
283
|
idempotent. Call `reset()` to start another epoch; its returned closure events
|
|
312
|
-
must also be consumed. Processing after finish raises `
|
|
284
|
+
must also be consumed. Processing after finish raises `VadRuntimeError`.
|
|
313
285
|
Typed errors carry `code` and `terminal_events`; drain those events even when
|
|
314
286
|
processing fails. `last_frame_probabilities()` returns the latest call's frame
|
|
315
287
|
index and an owned read-only float32 memoryview, independent of future calls.
|
|
316
288
|
|
|
317
|
-
`
|
|
289
|
+
`VadPostProcessor(VadOptions(...))` accepts probabilities from the
|
|
318
290
|
16 kHz/512-sample frame geometry and delegates to the same segmentation kernel.
|
|
319
|
-
`
|
|
291
|
+
`speech_segments(samples, params=None)` is the single whole-PCM helper
|
|
320
292
|
and uses the same streaming process/finish path with preview disabled.
|
|
321
293
|
|
|
322
|
-
The
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
`UnsupportedTap`. The producer's shared 48 kHz stereo branch supplies valid PCM
|
|
294
|
+
The capture option is `open(...,
|
|
295
|
+
vad=StreamVadOptions(params=..., provisional=True, tap='primary'))`.
|
|
296
|
+
Secondary taps are rejected with `UnsupportedTap`. The producer's shared 48 kHz stereo branch supplies valid PCM
|
|
326
297
|
and authoritative frame indices before output conversion. Attached chunks carry
|
|
327
|
-
`
|
|
298
|
+
`vad_events`; each epoch begins with its saved `capture_sample` and `pts_ns`
|
|
328
299
|
origin. `AudioChunk.frame_index` is a producer-owned 48 kHz timeline position.
|
|
329
|
-
`
|
|
300
|
+
`flush_vad()` and `stop()` queue ordered closing carriers even without new
|
|
330
301
|
PCM. Poll until the terminal carrier is consumed before releasing the stream.
|
|
331
302
|
An attached VAD failure is a failure of that session only: capture and PCM
|
|
332
303
|
delivery continue, and polling delivers its closing events without raising the
|
|
333
304
|
processor failure. `stop()` succeeds for a VAD-only failure; its shutdown report
|
|
334
|
-
retains the cause in `cleanup_errors` with `
|
|
335
|
-
capture-only. The next discontinuity (or a successful `
|
|
305
|
+
retains the cause in `cleanup_errors` with `vad_code`, and `primary` remains
|
|
306
|
+
capture-only. The next discontinuity (or a successful `flush_vad()`)
|
|
336
307
|
reinitializes the session so its next frame starts a new anchored epoch.
|
|
337
|
-
Disabled attachment has `AudioChunk.
|
|
338
|
-
Legacy `Vad` and its integration keep their existing behavior.
|
|
308
|
+
Disabled attachment has `AudioChunk.vad_events=None` and flush is a no-op.
|
|
339
309
|
|
|
@@ -7,7 +7,7 @@ per-process loopback) written in Rust. Built with PyO3 and maturin.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
pip install "flexaudio>=0.
|
|
10
|
+
pip install "flexaudio>=0.6,<0.7"
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
@@ -126,56 +126,22 @@ Platform behavior:
|
|
|
126
126
|
- Linux matches exact PIDs, without excluding descendants. Linux and Windows
|
|
127
127
|
ignore the selected system device while exclusion is active.
|
|
128
128
|
|
|
129
|
-
###
|
|
129
|
+
### Noise suppression and attached VAD
|
|
130
130
|
|
|
131
|
-
`
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
queues the actual 480-frame (10 ms) denoiser tail and pending VAD boundaries;
|
|
136
|
-
continue polling after stop to receive them. Repeated stop does not repeat tails.
|
|
137
|
-
Capture terminal failure suppresses remaining PCM and audio tails.
|
|
131
|
+
`denoise=True` enables RNNoise. Without VAD it processes delivered PCM during
|
|
132
|
+
polling; with VAD it processes the shared capture branch before VAD and output
|
|
133
|
+
conversion. It requires 48000 Hz output and introduces 480 samples/channel of delay.
|
|
134
|
+
Graceful stop queues the denoiser tail; continue polling to receive final output.
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
samples = np.frombuffer(chunk.data, dtype=np.float32) # denoised audio
|
|
145
|
-
for ev in chunk.vad_events: # speech boundaries
|
|
146
|
-
print(ev.type, ev.at_sample) # "speech_start"/"speech_end"
|
|
147
|
-
```
|
|
136
|
+
Attach the same generic VAD engine with
|
|
137
|
+
`vad=flexaudio.StreamVadOptions(provisional=True)`. Each chunk's `vad_events`
|
|
138
|
+
contains ordered segments, optional provisional hints, and epoch markers.
|
|
139
|
+
The fixed 20 ms chunk size preserves canonical capture conversion and ordering;
|
|
140
|
+
other chunk durations are rejected before opening a device.
|
|
148
141
|
|
|
149
|
-
`
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
standalone `Vad` (below). `at_sample` is measured at the VAD's internal rate
|
|
153
|
-
(16000 or 8000 Hz), not the input rate.
|
|
154
|
-
|
|
155
|
-
VAD emits `speech_start` and `speech_end` together when a segment is finalized,
|
|
156
|
-
not when speech first begins. On `DISCONTINUITY` (`chunk.flags & 1`), an open
|
|
157
|
-
pre-gap segment is flushed before the post-gap PCM is processed. Flushed events
|
|
158
|
-
come first and retain their pre-gap `at_sample` values; VAD then restarts its
|
|
159
|
-
sample clock at zero. These positions are separate from `chunk.pts_ns`.
|
|
160
|
-
|
|
161
|
-
Consumers distinguish timelines by the discontinuity chunk: the core always
|
|
162
|
-
delivers 20 ms chunks, which cannot complete a fresh 32 ms VAD inference frame.
|
|
163
|
-
Consequently **all events on the discontinuity chunk belong to the pre-gap
|
|
164
|
-
timeline**, and all events on subsequent chunks belong to the new timeline.
|
|
165
|
-
Handle that chunk's events under the previous timeline before advancing your
|
|
166
|
-
VAD timeline; the chunk's PCM itself already belongs to the post-gap timeline.
|
|
167
|
-
For example, a flushed pair at 0/512 on the discontinuity chunk is old; a pair
|
|
168
|
-
at 0/1024 delivered later is new. Do not infer the boundary from a decrease in
|
|
169
|
-
`at_sample`: delayed post-gap speech need not produce one. A mixed event list
|
|
170
|
-
from larger chunks would require an explicit flushed-event count or timeline
|
|
171
|
-
identifier; larger chunks are not supported by the current core.
|
|
172
|
-
|
|
173
|
-
If the discontinuity flush fails, VAD reset is still attempted and denoise is
|
|
174
|
-
still reset before `poll_chunk()` raises the flush error through its existing
|
|
175
|
-
exception path. That poll consumes the chunk. When reset succeeds, later
|
|
176
|
-
chunks process normally without repeating that flush error. If VAD reset
|
|
177
|
-
itself fails, its failure remains latched and subsequent processing reports
|
|
178
|
-
it until a reset succeeds.
|
|
142
|
+
On macOS, `silence_probe=False` disables the silence diagnosis tone. The default
|
|
143
|
+
is enabled: after five seconds of exact-zero system capture, a 1 kHz tone at
|
|
144
|
+
amplitude 1e-5 plays for 300 ms to help distinguish permission failure from silence.
|
|
179
145
|
|
|
180
146
|
### Standalone add-ons
|
|
181
147
|
|
|
@@ -183,9 +149,9 @@ The same building blocks are available as independent classes.
|
|
|
183
149
|
|
|
184
150
|
```python
|
|
185
151
|
# Voice activity detection over arbitrary-format PCM (mono/stereo, any rate).
|
|
186
|
-
vad = flexaudio.Vad(threshold=0.5, min_silence_ms=100)
|
|
152
|
+
vad = flexaudio.Vad(threshold=0.5, min_silence_ms=100)
|
|
187
153
|
for ev in vad.process(samples, input_sample_rate=48000, input_channels=2):
|
|
188
|
-
print(ev.type
|
|
154
|
+
print(ev.type)
|
|
189
155
|
|
|
190
156
|
# Noise suppression (48 kHz, +/-1.0 normalized interleaved f32).
|
|
191
157
|
den = flexaudio.Denoiser(channels=1)
|
|
@@ -230,9 +196,8 @@ path, reason, optional positive scalar-interleaved sample count, rate, and chann
|
|
|
230
196
|
exact chunk attribution; flags 8 (`PADDED`) and 16 (`CLIPPED`) instead describe
|
|
231
197
|
that delivered chunk. Padding alone does not imply a gap.
|
|
232
198
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
and compatibility. From 0.5.3, macOS microphone capture requires decided consent
|
|
199
|
+
`permissionPending` remains available for custom Rust backends; built-in sources
|
|
200
|
+
do not emit it. From 0.5.3, macOS microphone capture requires decided consent
|
|
236
201
|
before each start and does not continuously monitor authorization or revocation.
|
|
237
202
|
`error` and `terminalError` are terminal; `recoverableError` continues
|
|
238
203
|
capture. `terminal_error()` retains the typed capture primary. `shutdown_report()`
|
|
@@ -258,11 +223,15 @@ their models/tables and require no runtime files or network access:
|
|
|
258
223
|
- **flexaudio-denoise** — uses [nnnoiseless](https://github.com/jneem/nnnoiseless)
|
|
259
224
|
(BSD-3-Clause), a Rust port of RNNoise with embedded model weights.
|
|
260
225
|
|
|
261
|
-
###
|
|
226
|
+
### Generic VAD
|
|
262
227
|
|
|
263
|
-
`
|
|
228
|
+
`Vad` runs embedded Silero v6 on normalized float32, with
|
|
264
229
|
segmentation matching whisper.cpp pin `85a69493a601d4ff5a834064f7b7bac250bd8739`.
|
|
265
|
-
|
|
230
|
+
`process(samples, input_sample_rate=16000, input_channels=1)` accepts arbitrary
|
|
231
|
+
positive input rates/channel counts and converts to mono16k internally. Event
|
|
232
|
+
times use the input timeline, compensated for converter group delay. After raw
|
|
233
|
+
input validation, finite resampler overshoot is clipped internally to [-1, 1]. It accepts
|
|
234
|
+
a sequence or a contiguous one-dimensional native float32 buffer;
|
|
266
235
|
NumPy is optional. Buffer input is copied through Python bytes into owned Rust
|
|
267
236
|
float32 storage for Python 3.8 stable-ABI compatibility, and sequence input is
|
|
268
237
|
copied for that feed. Instances stay on their creating thread.
|
|
@@ -271,7 +240,7 @@ copied for that feed. Instances stay on their creating thread.
|
|
|
271
240
|
import array
|
|
272
241
|
import flexaudio
|
|
273
242
|
|
|
274
|
-
vad = flexaudio.
|
|
243
|
+
vad = flexaudio.Vad(provisional=True)
|
|
275
244
|
events = vad.process(memoryview(array.array('f', [0.0] * 513)))
|
|
276
245
|
events += vad.finish()
|
|
277
246
|
for event in events:
|
|
@@ -279,11 +248,14 @@ for event in events:
|
|
|
279
248
|
print(event.start_ms, event.end_ms)
|
|
280
249
|
```
|
|
281
250
|
|
|
282
|
-
Parameters are `threshold=0.5`, `
|
|
283
|
-
`
|
|
251
|
+
Parameters are `threshold=0.5`, `min_speech_ms=250`,
|
|
252
|
+
`min_silence_ms=100`, `max_speech_ms=0`, and
|
|
284
253
|
`speech_pad_ms=30`. Supplied zero values stay zero. Durations must be integers
|
|
285
254
|
in 0..134217; bool durations, unknown keys, invalid PCM and nonfinite parameters
|
|
286
|
-
are rejected.
|
|
255
|
+
are rejected. `max_speech_ms` is integer milliseconds; 0 or values above 100000000 use the
|
|
256
|
+
effectively unbounded legacy `INT_MAX/2`-sample sentinel (1073741823 samples). Other positive
|
|
257
|
+
values below one inference frame plus twice the padding budget are rejected; equality
|
|
258
|
+
(a zero split budget) is valid. Fixed
|
|
287
259
|
200 ms merging can undo splits: it does **not** bound final segment duration or
|
|
288
260
|
latency. Optional provisional cuts independently cap pieces at 30000 ms.
|
|
289
261
|
|
|
@@ -293,30 +265,28 @@ Events are read-only variant objects with snake_case fields and type tags:
|
|
|
293
265
|
final endpoints use the 10 ms grid and can exceed physical EOF. `finish()`
|
|
294
266
|
infers one zero-padded partial frame when needed, closes the epoch, and is
|
|
295
267
|
idempotent. Call `reset()` to start another epoch; its returned closure events
|
|
296
|
-
must also be consumed. Processing after finish raises `
|
|
268
|
+
must also be consumed. Processing after finish raises `VadRuntimeError`.
|
|
297
269
|
Typed errors carry `code` and `terminal_events`; drain those events even when
|
|
298
270
|
processing fails. `last_frame_probabilities()` returns the latest call's frame
|
|
299
271
|
index and an owned read-only float32 memoryview, independent of future calls.
|
|
300
272
|
|
|
301
|
-
`
|
|
273
|
+
`VadPostProcessor(VadOptions(...))` accepts probabilities from the
|
|
302
274
|
16 kHz/512-sample frame geometry and delegates to the same segmentation kernel.
|
|
303
|
-
`
|
|
275
|
+
`speech_segments(samples, params=None)` is the single whole-PCM helper
|
|
304
276
|
and uses the same streaming process/finish path with preview disabled.
|
|
305
277
|
|
|
306
|
-
The
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
`UnsupportedTap`. The producer's shared 48 kHz stereo branch supplies valid PCM
|
|
278
|
+
The capture option is `open(...,
|
|
279
|
+
vad=StreamVadOptions(params=..., provisional=True, tap='primary'))`.
|
|
280
|
+
Secondary taps are rejected with `UnsupportedTap`. The producer's shared 48 kHz stereo branch supplies valid PCM
|
|
310
281
|
and authoritative frame indices before output conversion. Attached chunks carry
|
|
311
|
-
`
|
|
282
|
+
`vad_events`; each epoch begins with its saved `capture_sample` and `pts_ns`
|
|
312
283
|
origin. `AudioChunk.frame_index` is a producer-owned 48 kHz timeline position.
|
|
313
|
-
`
|
|
284
|
+
`flush_vad()` and `stop()` queue ordered closing carriers even without new
|
|
314
285
|
PCM. Poll until the terminal carrier is consumed before releasing the stream.
|
|
315
286
|
An attached VAD failure is a failure of that session only: capture and PCM
|
|
316
287
|
delivery continue, and polling delivers its closing events without raising the
|
|
317
288
|
processor failure. `stop()` succeeds for a VAD-only failure; its shutdown report
|
|
318
|
-
retains the cause in `cleanup_errors` with `
|
|
319
|
-
capture-only. The next discontinuity (or a successful `
|
|
289
|
+
retains the cause in `cleanup_errors` with `vad_code`, and `primary` remains
|
|
290
|
+
capture-only. The next discontinuity (or a successful `flush_vad()`)
|
|
320
291
|
reinitializes the session so its next frame starts a new anchored epoch.
|
|
321
|
-
Disabled attachment has `AudioChunk.
|
|
322
|
-
Legacy `Vad` and its integration keep their existing behavior.
|
|
292
|
+
Disabled attachment has `AudioChunk.vad_events=None` and flush is a no-op.
|