Help us shape the future of Go! Take the 2026 Go Developer Survey

audiolive

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package audiolive serves a private browser companion for live audio translation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, options Options) error

Run owns the listener, private launch file, and all active API sessions.

Types

type Config

type Config struct {
	Language       string `json:"language"`
	NoiseReduction bool   `json:"noise_reduction"`
}

Config contains only the public controls used to start a translation session.

type Event

type Event struct {
	Type       string `json:"type"`
	Delta      string `json:"delta,omitempty"`
	Message    string `json:"message,omitempty"`
	Tokens     int64  `json:"tokens,omitempty"`
	Format     string `json:"format,omitempty"`
	SampleRate int    `json:"sample_rate,omitempty"`
	Channels   int    `json:"channels,omitempty"`
}

Event carries only display data. It never contains credentials or raw API errors.

type Failure

type Failure string

Failure contains an actionable message prepared by trusted application code. Unclassified errors never reach the browser.

func (Failure) Error

func (e Failure) Error() string

type Options

type Options struct {
	Connect     func(context.Context, Config) (Session, error)
	OpenBrowser func(context.Context, string) error
	Writer      io.Writer
}

type Session

type Session interface {
	Append(context.Context, []byte) error
	Receive(context.Context) (Event, error)
	FinishInput(context.Context) error
	Abort()
}

Session leaves API transport, credentials, and error classification with its caller.

Jump to

Keyboard shortcuts

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