localruntime

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ActionDownload       = "download"
	ActionDelete         = "delete"
	ActionInstallRuntime = "install-runtime"
	ActionDeleteRuntime  = "delete-runtime"
	ActionStart          = "start"
	ActionStop           = "stop"

	RuntimeUnavailable    = "unavailable"
	RuntimeNotImplemented = "not_implemented"
	RuntimeRunning        = "running"
	RuntimeStopped        = "stopped"
)

Variables

This section is empty.

Functions

func VoiceLanguageOfVoice added in v0.2.0

func VoiceLanguageOfVoice(voiceID string) string

VoiceLanguageOfVoice is the language code a Piper voice id starts with.

Types

type Runtime

type Runtime struct {
	// Offline keeps the bundled voice catalogs instead of fetching the
	// online ones.
	Offline bool
	// contains filtered or unexported fields
}

Runtime manages local voice and browser runtimes; the daemon builds one and closes it on shutdown, which stops the processes it started.

func New

func New(root string) *Runtime

New uses root for models, or the default local state dir when root is "".

func (*Runtime) ApplyBrowserAction added in v0.1.15

func (*Runtime) ApplyVoiceAction

func (r *Runtime) ApplyVoiceAction(ctx context.Context, moduleID string, provider VoiceProvider, request VoiceActionRequest) (VoiceProvider, error)

func (*Runtime) Close added in v0.2.0

func (r *Runtime) Close() error

func (*Runtime) DecorateBrowserModule added in v0.1.15

func (r *Runtime) DecorateBrowserModule(module setup.BrowserModuleDescriptor) setup.BrowserModuleDescriptor

func (*Runtime) DecorateBrowserProvider added in v0.1.15

func (r *Runtime) DecorateBrowserProvider(provider setup.BrowserProviderOption) setup.BrowserProviderOption

func (*Runtime) DecorateVoiceModules

func (r *Runtime) DecorateVoiceModules(modules []VoiceModule) []VoiceModule

func (*Runtime) DecorateVoiceProvider

func (r *Runtime) DecorateVoiceProvider(moduleID string, provider VoiceProvider) VoiceProvider

func (*Runtime) ManagedVoiceBinaryPath added in v0.1.10

func (r *Runtime) ManagedVoiceBinaryPath(provider VoiceProvider) (string, error)

func (*Runtime) PiperTextToSpeech

func (r *Runtime) PiperTextToSpeech(ctx context.Context, provider VoiceProvider, text string) ([]byte, error)

func (*Runtime) PlaywrightMCPServerConfig added in v0.1.15

func (r *Runtime) PlaywrightMCPServerConfig(provider setup.BrowserProviderOption) (setup.MCPServerConfig, bool)

func (*Runtime) StopVoiceRuntime added in v0.2.0

func (r *Runtime) StopVoiceRuntime(providerID string)

StopVoiceRuntime stops the provider's server when one runs.

func (*Runtime) SupertonicTextToSpeech added in v0.1.10

func (r *Runtime) SupertonicTextToSpeech(ctx context.Context, provider VoiceProvider, text string) ([]byte, error)

func (*Runtime) VoiceBinaryPath

func (r *Runtime) VoiceBinaryPath(provider VoiceProvider) (string, error)

func (*Runtime) VoiceModelInstalled

func (r *Runtime) VoiceModelInstalled(moduleID string, provider VoiceProvider) (bool, string)

func (*Runtime) VoiceModelInstalledForID

func (r *Runtime) VoiceModelInstalledForID(moduleID string, provider VoiceProvider, modelID string) (bool, string)

func (*Runtime) VoiceModelPath

func (r *Runtime) VoiceModelPath(moduleID string, provider VoiceProvider) string

func (*Runtime) VoiceModelPathForID

func (r *Runtime) VoiceModelPathForID(moduleID string, provider VoiceProvider, modelID string) string

func (*Runtime) VoiceRuntimeRSSBytes

func (r *Runtime) VoiceRuntimeRSSBytes(provider VoiceProvider) uint64

func (*Runtime) WhisperCLIPath

func (r *Runtime) WhisperCLIPath(provider VoiceProvider) (string, error)

func (*Runtime) WhisperServerPath

func (r *Runtime) WhisperServerPath(provider VoiceProvider) (string, error)

func (*Runtime) WhisperSpeechToText

func (r *Runtime) WhisperSpeechToText(ctx context.Context, provider VoiceProvider, input WhisperSpeechInput) (string, error)

type VoiceActionRequest added in v0.2.0

type VoiceActionRequest struct {
	Action  string
	ModelID string
}

VoiceActionRequest is a provider action and the model it applies to.

type VoiceModel added in v0.2.0

type VoiceModel struct {
	ID           string
	Name         string
	Size         string
	RAM          string
	Description  string
	Default      bool
	LanguageCode string
	LanguageName string
	Country      string
	Quality      string
	Installed    bool
	Path         string
}

VoiceModel is a model (STT) or a voice (TTS) a provider can download.

type VoiceModule added in v0.2.0

type VoiceModule struct {
	ID           string
	Title        string
	Enabled      bool
	ProviderID   string
	ProviderName string
	Local        bool
	Status       string
	Config       setup.VoiceProviderConfig
	Providers    []VoiceProvider
}

VoiceModule is the TTS or the STT module: its settings, its providers and, once decorated, their install and run state.

func VoiceModules added in v0.2.0

func VoiceModules(modules setup.ModulesConfig) []VoiceModule

VoiceModules are the TTS and STT modules of the config, undecorated.

type VoiceProvider added in v0.2.0

type VoiceProvider struct {
	ID               string
	Name             string
	Local            bool
	Status           string
	Endpoint         string
	Downloaded       bool // the selected model or voice is installed
	ModelPath        string
	RuntimeState     string
	RuntimeDetail    string
	RuntimePath      string
	RuntimeInstalled bool
	RuntimeRSS       uint64
	Config           setup.VoiceProviderConfig
	Models           []VoiceModel
}

VoiceProvider is a local voice engine with its effective settings.

type WhisperSpeechInput

type WhisperSpeechInput struct {
	Content  []byte
	FileName string
	MIMEType string
	Language string
}

Jump to

Keyboard shortcuts

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