noisefilter

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package noisefilter implements the bounded, pre-ASR PCM filtering contract. A failed or late filter never releases the original audio downstream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is session-local and called serially. Sequence numbers prevent a retry, reordered request, or expired sidecar state from corrupting audio.

func New

func New(config Config) (*Client, error)

func (*Client) Close

func (client *Client) Close()

func (*Client) Process

func (client *Client) Process(ctx context.Context, pcm []byte, rate uint32) ([]byte, error)

Process returns the same sample count. RNNoise has a 20ms streaming delay, DeepFilterNet3 40ms (42ms with FIR conversion), and real-tse advertises a 65ms bound including its FIFO and resampling. The caller must forward this result, never the original PCM, to admission. Large ingress packets are split into <=100ms processing requests, all sharing one delivery deadline so batching cannot multiply caller latency. Target jobs may finish state updates after that deadline, but their late PCM is discarded. There is no wait for a transcript or a complete utterance. Target extraction passes audio through its FIFO during initial enrollment; after activation it never falls back to raw audio or returns to enrollment.

func (*Client) Status

func (client *Client) Status() Status

type Config

type Config struct {
	URL       string `json:"url"`
	TimeoutMS int    `json:"timeout_ms"`
	Model     string `json:"model,omitempty"`
}

func (Config) ModelName

func (config Config) ModelName() string

func (Config) Validate

func (config Config) Validate() error

type Status

type Status struct {
	State       string  `json:"state"`
	LatePackets uint64  `json:"late_packets"`
	MutedMS     float64 `json:"muted_ms"`
	Reason      string  `json:"reason,omitempty"`
}

Status describes audio delivery, not acoustic target-presence confidence. Degraded is latched until a new session; it never initiates re-enrollment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL