Skip to main content

Rust speech gate with Python bindings

Project description

speechgate-rs

Rust implementation of the FASR energy speech gate with Python bindings.

import numpy as np
from speechgate_rs import EnergySpeechGate

audio = np.zeros(16000, dtype=np.float32)
gate = EnergySpeechGate(base_thresh=0.008, max_thresh=0.035)
mask = gate.compute_keep_mask(audio, sample_rate=16000)
gated = gate.apply_array(audio, sample_rate=16000)

The binding keeps the same energy-gate semantics as the Python EnergySpeechGate implementation in fasr-service-realtime: adaptive RMS thresholding, short voice-burst removal, short silence-gap filling, padding, silence pass windows, and fade envelopes.

For performance-sensitive checks, build the native extension in release mode:

env -u CONDA_PREFIX VIRTUAL_ENV=.venv maturin develop --release
uv run pytest tests -q

The test suite includes a NumPy reference implementation and verifies that the Rust binding returns identical masks/gated output/compacted output while running faster than the NumPy reference on the benchmark audio.

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

speechgate_rs-0.1.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

speechgate_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (287.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file speechgate_rs-0.1.0.tar.gz.

File metadata

  • Download URL: speechgate_rs-0.1.0.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for speechgate_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d2097df63fc487260fc5f8dd2c5cc4c2b4ea55a23ac015cdbc1fc8abd8f411b3
MD5 a99bf502e26e351b7b49ba7834863b23
BLAKE2b-256 885178381196978ec902a71fb2e081fce9beedbd7133090246d45c665d40900b

See more details on using hashes here.

File details

Details for the file speechgate_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: speechgate_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 287.1 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for speechgate_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0192b7633b646e251a1263b133724ae2a79aec2d3b0b82e32cf3acc9c02e1190
MD5 ce80841cd343f4a40a94ec0badedc824
BLAKE2b-256 c606b70e4831a9ed62429241a5653c870093e683057dd7c35bd6bade25a7870b

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