Documentation
¶
Index ¶
- func Available() bool
- type Engine
- func (e *Engine) RecordCtx(ctx context.Context, outPath string) error
- func (e *Engine) RecordFixed(outPath string, seconds int) error
- func (e *Engine) TranscribeCtx(ctx context.Context, audioPath string) (string, error)
- func (e *Engine) TranscribeReaderCtx(ctx context.Context, audio io.Reader, filename string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) RecordCtx ¶ added in v0.24.0
RecordCtx captures audio from the microphone using sox until the silence detector fires or the recordTimeout fallback expires. The caller's ctx is honoured: cancelling it kills the rec process. Records 16kHz mono WAV, stops after 1s of silence.
func (*Engine) RecordFixed ¶
RecordFixed captures audio for a fixed duration in seconds.
func (*Engine) TranscribeCtx ¶ added in v0.24.0
TranscribeCtx loads audioPath and forwards it to TranscribeReaderCtx. Honours ctx — cancelling it aborts the in-flight HTTP request so the REPL can return immediately on Ctrl+C even if the API hangs.
func (*Engine) TranscribeReaderCtx ¶ added in v0.24.0
func (e *Engine) TranscribeReaderCtx(ctx context.Context, audio io.Reader, filename string) (string, error)
TranscribeReaderCtx sends audio from a reader to OpenAI Whisper API. Honours ctx — cancelling it aborts the in-flight HTTP request so the REPL can return immediately on Ctrl+C even if the API hangs.