voice

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package voice provides the nexus.io.voice plugin: a bus-driven voice IO transport that consumes microphone audio chunks (voice.audio.input.chunk), runs simple energy-based VAD + ASR (OpenAI Whisper API) to emit io.input, and consumes llm.response to drive TTS (OpenAI /audio/speech) chunks back out (voice.audio.output.chunk).

Local-model providers are out of scope for this PR — see #92. Configuring asr.provider or tts.provider with a local-model id (e.g. local_whisper, faster_whisper, kokoro) makes Init return a clear error pointing operators at #92.

Barge-in: while a TTS turn is in flight (i.e. between llm.response and the final voice.audio.output.chunk), if any input chunk's RMS exceeds the barge-in threshold, we emit cancel.request{Source: "voice"} so the existing cooperative-cancellation chain terminates the in-flight LLM/turn. The new utterance is then processed normally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() engine.Plugin

New returns a new voice IO plugin instance.

Types

type Plugin

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

Plugin implements engine.Plugin for nexus.io.voice.

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []engine.Capability

func (*Plugin) ConfigSchema

func (p *Plugin) ConfigSchema() []byte

ConfigSchema implements engine.ConfigSchemaProvider.

func (*Plugin) Dependencies

func (p *Plugin) Dependencies() []string

func (*Plugin) Emissions

func (p *Plugin) Emissions() []string

func (*Plugin) ID

func (p *Plugin) ID() string

func (*Plugin) Init

func (p *Plugin) Init(ctx engine.PluginContext) error

Init parses config and wires bus subscriptions.

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Ready

func (p *Plugin) Ready() error

func (*Plugin) Requires

func (p *Plugin) Requires() []engine.Requirement

func (*Plugin) Shutdown

func (p *Plugin) Shutdown(ctx context.Context) error

Shutdown cancels any in-flight TTS and unsubscribes.

func (*Plugin) Subscriptions

func (p *Plugin) Subscriptions() []engine.EventSubscription

func (*Plugin) Version

func (p *Plugin) Version() string

Jump to

Keyboard shortcuts

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