Skip to content
providerkit
GitHub

SpeechResult

Defined in: core/src/speech-core.ts:39

bytes: Uint8Array;

Defined in: core/src/speech-core.ts:40


optional channels?: number;

Defined in: core/src/speech-core.ts:48

Only when the bytes or the provider state it.


characters: number;

Defined in: core/src/speech-core.ts:53

Characters sent after trimming, for endpoints billed per character.


optional durationMs?: number;

Defined in: core/src/speech-core.ts:51

Exact, from a WAV header that checks out. Absent for every other format: measuring those takes a decoder, and a guess here would be wrong in the ledger.


format: "wav" | "pcm" | "mp3" | "opus" | "aac" | "flac";

Defined in: core/src/speech-core.ts:42

Read from the bytes, so it can differ from the format asked for.


mimeType: string;

Defined in: core/src/speech-core.ts:44

The media type of format.


model: string;

Defined in: core/src/speech-core.ts:57

The model and voice that were asked for.


optional sampleRate?: number;

Defined in: core/src/speech-core.ts:46

Hz. Only when the bytes (a WAV header) or the request state it.


optional usage?: SpeechUsage;

Defined in: core/src/speech-core.ts:55

Only when the provider reported it. Never estimated.


voice: string;

Defined in: core/src/speech-core.ts:58