//clika-runtime/io.clika.modelverse/SttModel
SttModel
[common]
class SttModel : PreTrainedModel
A speech recognition model loaded from its files on disk, on the CPU.
Open it with open from a snapshot directory. Hand it a clip as 16-bit PCM with transcribe; the text arrives through the listener on the model's own worker thread, one clip at a time per model. close frees the weights.
Types
| Name | Summary |
|---|---|
| Companion | [common] object Companion |
Properties
| Name | Summary |
|---|---|
| capabilities | [common] val capabilities: Capabilities What the model takes and gives, read when it opened. |
| config | [common] open override val config: PretrainedConfig The checkpoint's identity, read when the model opened. |
Functions
| Name | Summary |
|---|---|
| close | [common] open fun close() |
| residency | [common] open override fun residency(): ResidencyReport Free the model. A running request is canceled first and the call waits for it to return; called from inside a listener callback, the free runs right after that callback's request ends instead. Idempotent. |
| transcribe | [common] fun transcribe(pcm16: ShortArray, sampleRate: Int, options: TranscribeOptions, listener: TranscribeListener): TranscribeHandle Transcribe pcm16, mono 16-bit samples at sampleRate hertz (the clip is resampled to the model's rate), under options. Returns at once; the worker runs the request and calls listener on its thread: the clip's text as one TranscriptSegment spanning the clip, then TranscribeListener.onDone with the TranscribeReport, the language the clip was read in among its facts. A clip longer than the model's window is transcribed window by window into that one segment. |