stt

package
v1.3.69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FallbackTranscriber added in v1.1.34

type FallbackTranscriber struct {
	// contains filtered or unexported fields
}

FallbackTranscriber tries the primary transcriber first, then falls back to the secondary.

func NewFallback added in v1.1.34

func NewFallback(primary, secondary Transcriber) *FallbackTranscriber

NewFallback creates a transcriber that tries primary first, then secondary on failure. Either can be nil and will be skipped.

func (*FallbackTranscriber) Transcribe added in v1.1.34

func (f *FallbackTranscriber) Transcribe(ctx context.Context, req Request) (Result, error)

type LocalWhisper added in v1.1.34

type LocalWhisper struct {
	// contains filtered or unexported fields
}

LocalWhisper uses a local whisper CLI binary for transcription.

func NewLocalWhisper added in v1.1.34

func NewLocalWhisper(binPath, model, language string) *LocalWhisper

NewLocalWhisper creates a local whisper transcriber. binPath is the path to the whisper binary (empty = auto-detect). model is the whisper model size (empty = "turbo" for speed + accuracy). language is the language code (empty = auto-detect).

func (*LocalWhisper) Available added in v1.1.34

func (w *LocalWhisper) Available() bool

Available checks if local whisper is usable without blocking.

func (*LocalWhisper) Transcribe added in v1.1.34

func (w *LocalWhisper) Transcribe(ctx context.Context, req Request) (Result, error)

type OpenAICompatible

type OpenAICompatible struct {
	// contains filtered or unexported fields
}

func NewOpenAICompatible

func NewOpenAICompatible(baseURL, apiKey, model, provider string) *OpenAICompatible

func (*OpenAICompatible) Transcribe

func (t *OpenAICompatible) Transcribe(ctx context.Context, req Request) (Result, error)

type Request

type Request struct {
	MIME       string
	Name       string
	Path       string
	DataBase64 string
	Metadata   map[string]string
}

type Result

type Result struct {
	Text       string
	Provider   string
	Model      string
	Confidence float64
	Duration   time.Duration
	Metadata   map[string]string
}

type Transcriber

type Transcriber interface {
	Transcribe(context.Context, Request) (Result, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL