C API reference · Kjarni 0.2.8
transcriber
kjarni_transcriber_config_default
struct KjarniTranscriberConfig kjarni_transcriber_config_default(void);
Get default transcriber configuration.
kjarni_transcriber_new
enum KjarniErrorCode kjarni_transcriber_new(const struct KjarniTranscriberConfig *config, struct KjarniTranscriber **out);
Create a new Transcriber. Downloads the model on first use.
Safety
configmust be null (defaults) or point to a valid config whose strings are null or nul-terminated.outmust be a valid, writable pointer.
kjarni_transcriber_free
void kjarni_transcriber_free(struct KjarniTranscriber *transcriber);
Free a Transcriber.
Safety
transcribermust be null, or a handle fromkjarni_transcriber_newnot already freed.
kjarni_transcriber_transcribe_file
enum KjarniErrorCode kjarni_transcriber_transcribe_file(const struct KjarniTranscriber *transcriber, const char *path, struct KjarniTranscription *out);
Transcribe an audio file (wav, mp3, flac or ogg).
Safety
transcribermust be a live handle;patha nul-terminated string.outmust be a valid, writable pointer. It is written on success and on failure; free it withkjarni_transcription_freeeither way.
kjarni_transcriber_transcribe_pcm
enum KjarniErrorCode kjarni_transcriber_transcribe_pcm(const struct KjarniTranscriber *transcriber, const float *samples, uintptr_t len, uint32_t sample_rate, struct KjarniTranscription *out);
Transcribe raw mono PCM samples in -1..1 at any sample rate; they are resampled to 16 kHz.
Safety
transcribermust be a live handle.samplesmust point tolenreadable floats (it may be null whenlenis 0).outmust be a valid, writable pointer; free it withkjarni_transcription_freeeither way.
Kjarni runs the same engine on every platform: