Audio

interface Audio

Learn how to turn audio into text.

Inheritors

Functions

Link copied to clipboard
open suspend fun createSpeech(request: SpeechRequest, options: SpeechOptions, requestOptions: RequestOptions? = null): ByteArray

Generates complete audio with voice instructions or a custom voice reference.

Link copied to clipboard
abstract suspend fun speech(request: SpeechRequest, requestOptions: RequestOptions? = null): ByteArray

Generates audio from the input text.

Link copied to clipboard
open fun speechAudio(request: SpeechRequest, options: SpeechOptions = SpeechOptions(), requestOptions: RequestOptions? = null): Flow<ByteArray>

Streams binary speech audio chunks. Collection starts the request; cancellation closes it.

Link copied to clipboard
open fun speechEvents(request: SpeechRequest, options: SpeechOptions = SpeechOptions(), requestOptions: RequestOptions? = null): Flow<SpeechEvent>

Streams base64 audio deltas and completion usage using server-sent events.

Link copied to clipboard
open suspend fun transcribe(request: TranscriptionRequest, options: TranscriptionOptions, requestOptions: RequestOptions? = null): AudioTranscription

Transcribes audio with modern controls and returns usage, confidence and speaker data.

Link copied to clipboard
abstract suspend fun transcription(request: TranscriptionRequest, requestOptions: RequestOptions? = null): Transcription

Transcribes audio into the input language.

Link copied to clipboard
open fun transcriptions(request: TranscriptionRequest, options: TranscriptionOptions = TranscriptionOptions(), requestOptions: RequestOptions? = null): Flow<TranscriptionEvent>

Streams transcription text, completion and speaker-segment events. Collection starts the request. Cancelling collection releases the response. Model support for streaming varies.

Link copied to clipboard
abstract suspend fun translation(request: TranslationRequest, requestOptions: RequestOptions? = null): Translation

Translates audio into English.