Two objects, two threads
Analysis models are far too expensive to run inside a real-time audio callback. The SDK therefore splits real-time analysis into a pair of objects that are created together and share one analysis model:
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
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 collector pair in Node.js and C.
Audio Format
Mono requirements, block sizes, and what each audio entry point expects.