WhisperTranscriptionClient

Stateless HTTP client for forwarding audio to a Whisper-compatible transcription endpoint.

Supports two modes:

  • Local: multipart POST to http://127.0.0.1:<port>/inference (whisper.cpp server).

  • External: multipart POST to <baseUrl>/v1/audio/transcriptions (OpenAI-compatible API).

Parameters

log

Log function for diagnostic output.

Constructors

Link copied to clipboard
constructor(log: (CodBi.LogLevel, String) -> Unit)

Functions

Link copied to clipboard
fun transcribeExternal(audioBytes: ByteArray, baseUrl: String, apiKey: String?, model: String, language: String?): String

Sends audio bytes to an external OpenAI-compatible /v1/audio/transcriptions endpoint.

Link copied to clipboard
fun transcribeLocal(audioBytes: ByteArray, port: Int, language: String?): String

Sends audio bytes to the local whisper-server /inference endpoint.