For LiveKit Agents, the ai-coustics-maintained plugins provide an
Analyzer that schedules
inference and exposes its collector as a frame processor. See
Audio-quality analysis with LiveKit.Two objects, two threads
Analysis models process multiple audio blocks at once. Running that work inside a real-time audio callback would create CPU spikes that could interrupt audio playback. To keep callback processing predictable, the SDK separates audio collection from analysis. In Python, Rust, C++ and C, these roles use two objects that are created together and share one analysis model. The examples below use Python. Node.js and WASM expose both roles through oneAnalyzer object. In Node.js, use analyzeAsync() to run analysis on a worker thread while continuing to collect audio (see Entry points per language).
Nothing is analyzed on its own. The collector only keeps audio, and the model runs when you call the analyzer. The two are safe to use at the same time: the collector may keep buffering on the audio thread while an analysis is in progress.
The collector holds a rolling window whose length is determined by the analysis model, which is five seconds for Tyto. As new samples arrive, the oldest audio is discarded, so each analysis scores the most recent five seconds of the stream.
Set up the pair
Create the pair from an analysis model, then initialize the collector the same way you would initialize a processor. Analysis models are the only model type accepted here, so passing an enhancement or VAD model raisesModelTypeUnsupportedError.
initialize allocates memory, so call it during setup rather than on an audio thread. The collector takes mono float32 blocks and accepts the same variable_block_size flag as the processor. See Audio Format.
Buffer and analyze
Feed the collector wherever you receive audio, and drive the analyzer from a separate thread on a timer:Every call returns a complete
AnalysisResult: the Tyto Risk Score plus all six dimensions. Use the smoothing and aggregation guidance before triggering interventions, so one aberrant window cannot flip your application’s behavior.The first few seconds
The analysis model always consumes a fixed length of audio. If you analyze before the collector has buffered that much, the tail of the input is analyzed as silence, which skews the scores toward whatever a partly silent window looks like. Wait until the stream has run for one full window before you act on a score. Counting the samples you have passed to the collector is enough:Reset between streams
Reset when the stream is interrupted, when you seek, or when you reuse the pair for a different call. Callinganalyzer.reset() clears the paired collector’s buffered audio, and the collector stays initialized to its configured audio settings:
Running alongside enhancement and VAD
The collector reads its input without modifying it, exactly like the VAD. All three objects can therefore share one input block, and you should give the collector the original audio so Tyto scores what actually arrived from the user:When analysis stops being allowed
analyze_buffered() raises ProcessingNotAllowedError when the SDK key was not authorized or usage reporting failed, most often because the machine lost its internet connection. This can happen mid-stream and not only at startup, so handle it in your analysis loop rather than treating a successful setup as proof that analysis will keep working:
Entry points per language
In Node.js, call
analyzer.initialize(sampleRate, blockSize, false) before buffering mono Float32Array blocks. analyze() blocks the calling thread; analyzeAsync() runs inference on a libuv worker thread so the event loop remains available and buffer() can continue collecting audio during analysis.
Find out more
Tyto: Audio Insight
What Tyto measures, how to interpret each dimension, and how to pick thresholds.
Batch Call Analysis
Score a folder of recordings offline and explore them in the dashboard.
SDK Examples
Runnable analysis examples across the SDK bindings, including the combined Analyzer in Node.js and the analyzer/collector pair in C.
Audio Format
Mono requirements, block sizes, and what each audio entry point expects.