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 ¶
- func New() engine.Plugin
- type Plugin
- func (p *Plugin) Capabilities() []engine.Capability
- func (p *Plugin) ConfigSchema() []byte
- func (p *Plugin) Dependencies() []string
- func (p *Plugin) Emissions() []string
- func (p *Plugin) ID() string
- func (p *Plugin) Init(ctx engine.PluginContext) error
- func (p *Plugin) Name() string
- func (p *Plugin) Ready() error
- func (p *Plugin) Requires() []engine.Requirement
- func (p *Plugin) Shutdown(ctx context.Context) error
- func (p *Plugin) Subscriptions() []engine.EventSubscription
- func (p *Plugin) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
ConfigSchema implements engine.ConfigSchemaProvider.
func (*Plugin) Dependencies ¶
func (*Plugin) Init ¶
func (p *Plugin) Init(ctx engine.PluginContext) error
Init parses config and wires bus subscriptions.
func (*Plugin) Requires ¶
func (p *Plugin) Requires() []engine.Requirement
func (*Plugin) Subscriptions ¶
func (p *Plugin) Subscriptions() []engine.EventSubscription