emitTranscript (stt/provider.go)

voiceblender · internal/stt/provider.go · go · MIT
voice, Voice / Speech

Utility to dispatch transcript and turn events to callbacks.

// Source: https://github.com/VoiceBlender/voiceblender | License: MIT | Copyright 2026 Messageroute Ltd
// Provided via justclaw.it.com; keep this notice with the code.
package stt

import (
	"context"
	"io"
)

// Provider is the common interface for speech-to-text backends.
type Provider interface {
	Start(ctx context.Context, reader io.Reader, apiKey string,
		opts Options, cb TranscriptCallback) error
	Stop()
	Running() bool
}

// Finalizer is implemented by providers that can flush the server-side audio
// buffer mid-stream, forcing a final transcript for what has been spoken so
// far WITHOUT closing the session. Optional: only Deepgram supports it today,
// so callers must type-assert rather than assume every Provider has it.
// Deepgram Flux does NOT — /v2/listen has no Finalize me

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key