Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLITranscriber ¶
type CLITranscriber struct {
Binary string // whisper.cpp CLI; defaults to "whisper-cli"
Model string // path to a ggml model; required
Language string // language code or "auto"; defaults to "auto"
Threads int // worker threads; 0 leaves the whisper.cpp default
}
CLITranscriber shells out to the whisper.cpp command-line tool. It is the quick-to-run backend; a CGO-linked backend can replace it behind this same interface without changing callers.
func NewCLITranscriber ¶
func NewCLITranscriber(model string) *CLITranscriber
func (*CLITranscriber) Transcribe ¶
type FFmpegRecorder ¶
type FFmpegRecorder struct {
Binary string // ffmpeg executable; defaults to "ffmpeg"
Device string // avfoundation audio device; defaults to ":0"
SampleRate int // output sample rate in Hz; defaults to 16000
MaxSeconds int // hard cap on recording length; defaults to 60
}
FFmpegRecorder records from a macOS avfoundation input device using ffmpeg.
func NewFFmpegRecorder ¶
func NewFFmpegRecorder() *FFmpegRecorder
type FakeRecorder ¶
FakeRecorder returns a fixed path, for tests that don't touch a microphone.
type FakeTranscriber ¶
FakeTranscriber returns fixed text and records the WAV paths it was given.
func (*FakeTranscriber) Transcribe ¶
type Recorder ¶
type Recorder interface {
// Record captures audio until ctx is cancelled (or an internal cap is
// reached), then returns the path to a 16 kHz mono WAV file. The caller owns
// the file and is responsible for removing it.
Record(ctx context.Context) (string, error)
}
Recorder captures microphone audio to a WAV file.
Click to show internal directories.
Click to hide internal directories.