Whistle

object Whistle(source)

Speech to text with Cactus Compute's Whistle (Apache 2.0, 16.9 MB): English, German, French, Spanish, Italian, Dutch and Polish, with word timings. Runs on Cactus's needle engine, a native library (src/main/cpp), CPU only. The engine keeps one model for the whole process and isn't thread-safe, so every call here is serialized.

Functions

Link copied to clipboard

Loads model (a .cact file) once; false if this device can't run it.

Link copied to clipboard
fun transcribe(pcm: FloatArray, language: String? = null, keywords: List<String> = emptyList()): Transcript?

Transcribes 16 kHz mono audio in -1, 1; language "en" etc., or null to detect it. keywords: words and names to listen for (keyword biasing); names come out far better with them. Null if the engine failed.