(bytes->floats bs)
(default-mono-format)
(downsample bs from-sample-rate to-sample-rate)
Convert the sound samples, bs
from from-sample-rate
to to-sample-rate
.
The sound samples must be pcmf32.
Convert the sound samples, `bs` from `from-sample-rate` to `to-sample-rate`. The sound samples must be pcmf32.
(pcms16->pcmf32 bs)
Convert a byte array of PCM signed shorts, return a byte array of pcm signed 32 bit floats.
Convert a byte array of PCM signed shorts, return a byte array of pcm signed 32 bit floats.
(read-wav file-path)
Reads a wav file and returns a byte array in PCM signed shorts format.
Reads a wav file and returns a byte array in PCM signed shorts format.
(record-and-transcribe model-path)
Starts recording audio from the default system microphone.
Returns a function that will stop recording and return the transcribed text when called.
Starts recording audio from the default system microphone. Returns a function that will stop recording and return the transcribed text when called.
(record-audio)
(record-audio opts)
Records audio from the default microphone.
Returns a function that will stop recording and return the recorded audio as a byte array in mono, signed short format.
Records audio from the default microphone. Returns a function that will stop recording and return the recorded audio as a byte array in mono, signed short format.
(transcribe model-path bs)
Given a model-path
to a whisper model and a byte array of
sound samples, return a string with the transcribed text.
The sounds samples must be in pcm signed 32 bit float format with a sampling rate of 16,000.
Given a `model-path` to a whisper model and a byte array of sound samples, return a string with the transcribed text. The sounds samples must be in pcm signed 32 bit float format with a sampling rate of 16,000.
(transcribe-wav model-path wav-path)
Given the path to a whisper model and a wav file, return the transcribed text.
Given the path to a whisper model and a wav file, return the transcribed text.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close