Public surface of revoice. Import the top-level names directly from the
package; the submodules hold the finer-grained helpers.
from revoice import (
denoise, dereverb, declip, conceal,
evaluate, Pipeline, build_pipeline,
stft, istft, StftConfig, __version__,
)denoise(signal, *, method="wiener", config=None, noise_percentile=10.0, oversubtraction=1.5, floor=0.02)
Denoise a noisy speech signal by short-time spectral attenuation. method
is "wiener" or "spectral_subtraction". Returns a signal the same length
as the input.
Suppress late reverberation. decay in (0, 1) sets tail strength, delay
is the onset of the late tail in frames.
Reconstruct clipped regions by cubic interpolation. threshold is
auto-detected from the peak when omitted.
Fill lost samples (marked by the boolean lost mask) using
waveform-similarity extrapolation.
Compute all metrics at once: snr, segmental_snr, lsd, stoi, pesq.
Compose restoration stages. Pipeline().add(fn) appends any
Signal -> Signal callable; add_named("denoise") wires a built-in.
build_pipeline(["declip", "denoise"]) is a shortcut.
Forward and inverse STFT. StftConfig(n_fft=512, hop=128, window="hann")
carries the parameters.
snr, segmental_snr, log_spectral_distance, stoi, pesq, evaluate.
Higher is better everywhere except log_spectral_distance (lower is better).
add_noise(signal, snr_db, *, rng=None, color="white"),
add_reverb(signal, *, rt60=0.4, sample_rate=16000, rng=None),
clip(signal, threshold),
drop_packets(signal, *, packet_ms=20.0, loss_rate=0.1, sample_rate=16000, rng=None)
returning (corrupted, lost_mask).
read_wav(path) -> (signal, sample_rate) and
write_wav(path, signal, sample_rate).
get_window(name, length), hann, hamming, cosine, sqrt_hann, and
check_cola(window, hop, *, tol=1e-6).
torch_available(), resolve_backend(name), and the FFT entry points
rfft / irfft that dispatch to NumPy or PyTorch.