whispercpp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package whispercpp is a speech-to-text provider for a local whisper.cpp server. whisper.cpp's HTTP server exposes an OpenAI-compatible /v1/audio/transcriptions endpoint, so this provider is a thin wrapper over the OpenAI-compatible transcription service pointed at a local URL.

It is segmented: a turn detector upstream delimits each utterance, which is uploaded and transcribed in one request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSTT

func NewSTT(cfg Config) *stt.SegmentService

NewSTT builds a whisper.cpp transcription service.

Types

type Config

type Config struct {
	// BaseURL is the OpenAI-compatible API base of the local server, including
	// any version segment (e.g. http://localhost:8080/v1). Required.
	BaseURL string `validate:"required,url"`
	// APIKey is an optional bearer token; most local servers need none.
	APIKey string
	// Model overrides the model field sent with each request.
	Model string
	// Language of the audio, sent as an ISO code; the zero value omits it
	// (auto-detect).
	Language language.Language
	// SampleRate is the input audio sample rate; 0 uses the transport's rate.
	SampleRate int

	// TTFSP99 overrides the measured transcript latency the turn strategies
	// size their wait by; 0 uses stt.WhisperTTFSP99.
	TTFSP99 time.Duration
}

Config configures the whisper.cpp STT provider.

func (Config) Validate

func (c Config) Validate() error

Validate reports whether the configuration is usable.

Jump to

Keyboard shortcuts

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