transcribeExternal

fun transcribeExternal(audioBytes: ByteArray, baseUrl: String, apiKey: String?, model: String, language: String?): String

Invia byte audio a un endpoint /v1/audio/transcriptions esterno compatibile con OpenAI.

Return

Il testo trascritto.

Parameters

audioBytes

Raw audio bytes (WebM/Opus, WAV, etc.).

baseUrl

Base URL of the external API (e.g. "https://api.openai.com").

apiKey

Bearer token / API key, or null if not required.

model

Model identifier (e.g. "whisper-1").

language

Optional BCP-47 language hint, or null for auto-detect.

Throws

If the external API returns a non-2xx HTTP status.