audio

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package audio is the only way apps use speech capabilities (docs/adr/0014-audio-service-transcription.md): a thin client for platformd's audio service on the internal plane. Apps are blind to the backend — Lemonade when configured, a clearly-marked stub until then.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(app string) *Client

New returns the audio client for an app. The plane address comes from BESPOKE_AUDIO_URL, falling back to BESPOKE_LLM_URL (same listener), then the local default.

func (*Client) Speak

func (c *Client) Speak(ctx context.Context, text string) (io.ReadCloser, string, error)

Speak synthesizes text to speech (local TTS via the platform's audio service). Returns the audio stream and its content type; the caller must Close the reader. Errors when no local TTS backend is configured.

func (*Client) Transcribe

func (c *Client) Transcribe(ctx context.Context, r io.Reader, opts ...Option) (string, error)

Transcribe converts spoken audio to text.

type Option

type Option func(*settings)

func WithMIME

func WithMIME(m string) Option

WithMIME sets the audio content type (default audio/webm — what the pkg/ui recorder produces).

Jump to

Keyboard shortcuts

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