voice

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 20 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

Overview

Package voice is the local text-to-speech and speech-to-text modules.

Index

Constants

View Source
const TextToSpeechToolID = "text_to_speech"

Variables

View Source
var (
	ErrModuleDisabled      = errors.New("voice module is disabled")
	ErrUnsupportedProvider = errors.New("voice provider is not supported yet")
	ErrProviderUnavailable = errors.New("voice provider is unavailable")
	ErrInvalidRequest      = errors.New("invalid voice request")
)

Functions

This section is empty.

Types

type Module added in v0.2.0

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

Module is the TTS or the STT module; both run on the daemon's local runtime.

func New added in v0.2.0

func New(id string, runtime *localruntime.Runtime) *Module

func (*Module) Apply added in v0.2.0

func (m *Module) Apply(_ context.Context, cfg setup.Config) error

Apply stores the module's settings and, when they changed, starts the selected always-running runtime in the background and stops the others.

func (*Module) Change added in v0.2.0

func (m *Module) Change(ctx context.Context, path []string, value string) (modules.Change, error)

Change chooses the provider, installs or deletes an engine, adds, uses or deletes a model or voice, or sets one of a provider's settings.

func (*Module) Close added in v0.2.0

func (m *Module) Close() error

func (*Module) ID added in v0.2.0

func (m *Module) ID() string

func (*Module) Settings added in v0.2.0

func (m *Module) Settings(context.Context) []modules.Item

Settings are the provider choice, a page per provider (engine, models or voices, language, threads, run mode) and the module's status.

func (*Module) SpeechToText added in v0.2.0

func (m *Module) SpeechToText(ctx context.Context, req SpeechToTextRequest) (SpeechToTextResponse, error)

func (*Module) Status added in v0.2.0

func (m *Module) Status(context.Context) modules.Status

func (*Module) TextToSpeech added in v0.2.0

func (m *Module) TextToSpeech(ctx context.Context, req TextToSpeechRequest) (TextToSpeechResponse, error)

func (*Module) Tools added in v0.2.0

func (m *Module) Tools() []tools.Executor

type SpeechToTextRequest

type SpeechToTextRequest struct {
	ContentBase64 string `json:"content_base64"`
	FileName      string `json:"file_name,omitempty"`
	MIMEType      string `json:"mime_type,omitempty"`
	Language      string `json:"language,omitempty"`
}

func NewSpeechToTextRequest

func NewSpeechToTextRequest(content []byte, fileName string, mimeType string) SpeechToTextRequest

func (SpeechToTextRequest) ContentBytes

func (r SpeechToTextRequest) ContentBytes() ([]byte, error)

type SpeechToTextResponse

type SpeechToTextResponse struct {
	Text string `json:"text"`
}

type TextToSpeechRequest

type TextToSpeechRequest struct {
	Text     string `json:"text"`
	VoiceID  string `json:"voice_id,omitempty"`
	Language string `json:"language,omitempty"`
}

type TextToSpeechResponse

type TextToSpeechResponse struct {
	ContentBase64 string `json:"content_base64"`
	MIMEType      string `json:"mime_type"`
	FileName      string `json:"file_name"`
}

func NewTextToSpeechResponse

func NewTextToSpeechResponse(content []byte, mimeType string, fileName string) TextToSpeechResponse

func (TextToSpeechResponse) ContentBytes

func (r TextToSpeechResponse) ContentBytes() ([]byte, error)

Directories

Path Synopsis
providers/gemini
Package gemini is the Gemini Live realtime voice provider.
Package gemini is the Gemini Live realtime voice provider.
providers/grok
Package grok is the xAI Grok Voice realtime voice provider.
Package grok is the xAI Grok Voice realtime voice provider.
providers/openai
Package openai is the OpenAI Realtime voice provider.
Package openai is the OpenAI Realtime voice provider.

Jump to

Keyboard shortcuts

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