VoskSpeechToText

org.llm4s.speech.stt.VoskSpeechToText
See theVoskSpeechToText companion object
final class VoskSpeechToText(modelPath: Option[String], targetSampleRate: Int, bufferSize: Int) extends SpeechToText

Vosk-based speech-to-text implementation. Replaces Sphinx4 as it's more actively maintained and has better performance.

Value parameters

bufferSize

Buffer size for audio processing (bytes). Larger sizes may improve throughput.

modelPath

Path to the Vosk model directory. Defaults to standard Vosk model location.

targetSampleRate

Target sample rate for audio preprocessing (Hz). Vosk standard is 16000.

Attributes

Companion
object
Graph
Supertypes
trait SpeechToText
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def close(): Unit

Close the cached Vosk model and release resources. Safe to call multiple times (idempotent). Should be called when the instance is no longer needed, especially in long-lived processes.

Close the cached Vosk model and release resources. Safe to call multiple times (idempotent). Should be called when the instance is no longer needed, especially in long-lived processes.

Attributes

override def transcribe(input: AudioInput, options: STTOptions): Result[Transcription]

Transcribe audio to text.

Transcribe audio to text.

Value parameters

input

Audio data to transcribe

options

Configuration for transcription

Attributes

Returns

Result containing Transcription or STTError

Throws
STTError

if transcription fails (wrapped in Result)

Definition Classes

Inherited methods

def isAvailable: Result[Boolean]

Check if this provider is available/healthy. Useful for failover logic and availability checks.

Check if this provider is available/healthy. Useful for failover logic and availability checks.

Attributes

Inherited from:
SpeechToText

Concrete fields

override val name: String

Unique identifier/name of this provider

Unique identifier/name of this provider

Attributes

override val supportedFormats: List[String]

List supported audio formats (e.g., "audio/wav", "audio/mp3")

List supported audio formats (e.g., "audio/wav", "audio/mp3")

Attributes