Tessera Session
Streaming multi-metric session — feed audio incrementally, get results on demand.
What is a Tessera Session?
The streaming counterpart to Tessera.analyze. Instead of passing a complete PitchContour, you feed raw audio or pre-extracted pitch incrementally via addAudio / addPitch. When you want results, call getResult — breath and agility are computed in batch on the full accumulated contour; vocal range bounds (lower/upper) come from a streaming histogram that updates as pitch arrives, while the search vector is recomputed in batch from the accumulated contour.
When to Use
| Scenario | Use This | Why |
|---|---|---|
| Live voice profiling while recording | Yes | Incremental accumulation |
| Batch analysis from a complete recording | No | Use Tessera.analyze |
| Interactive guided range detection | No | Use TesseraRangeSession |
Quick Start
Kotlin
val session = TesseraSession.create()
recorder.audioBuffers.collect { buffer ->
session.addAudio(buffer.samples, sampleRate = 48000)
}
val result = session.getResult()
println("Breath: ${result.breath?.controlScore}")
session.release()Swift
let session = TesseraSession.create()
for await buffer in recorder.audioBuffers {
session.addAudio(samples: buffer.samples, sampleRate: Int32(hwRate))
}
let result = session.getResult()
print("Breath: \(result.breath?.controlScore ?? 0)")
session.release()Common Pitfalls
Call
release()when done: Holds a pitch detector and range detector internally.addAudiorequires a detector: The defaultcreate()always creates one. If you only useaddPitch, the internal detector is created but unused — a minor overhead, not an error.getResult()can be called multiple times: Each call recomputes breath/agility on the accumulated data. Range uses the streaming histogram so it's cheap.Max session duration is 10 minutes: After that, old pitch points are trimmed from the accumulator.
See also
Batch counterpart (single-call analysis)
For guided interactive range detection
The result type (shared with Tessera)