voice

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package voice transcribes inbound voice traffic into text messages.

Index

Constants

View Source
const UtteranceSilenceWindow = 1500 * time.Millisecond

UtteranceSilenceWindow matches the current Discord-style utterance timeout.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

Processor collects Discord voice audio into utterances and transcribes them.

func NewProcessor

func NewProcessor(
	bus *events.Bus,
	transcriber *openaiaudio.WhisperClient,
	logger *slog.Logger,
	emergencySafeWords []string,
	beforeMainSession func(context.Context, string) (*events.SlackReplyTarget, error),
) *Processor

NewProcessor constructs a voice processor.

func (*Processor) Start

func (p *Processor) Start(ctx context.Context)

Start begins processing voice chunks until the context is canceled.

type TranscriptionPublisher

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

TranscriptionPublisher relays transcribed voice text into the shared main session.

func NewTranscriptionPublisher

func NewTranscriptionPublisher(
	bus *events.Bus,
	logger *slog.Logger,
	source events.Source,
	emergencySafeWords []string,
	beforeMainSession func(context.Context, string) (*events.SlackReplyTarget, error),
) *TranscriptionPublisher

NewTranscriptionPublisher constructs a reusable voice transcription publisher.

func (*TranscriptionPublisher) PublishTranscription

func (p *TranscriptionPublisher) PublishTranscription(ctx context.Context, text, webSessionID string) (bool, error)

PublishTranscription publishes a transcribed utterance into the main conversation.

Jump to

Keyboard shortcuts

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