tts

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tts turns replies into voice messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Speakable

func Speakable(md string) string

Speakable strips Markdown and code so only prose is read aloud.

Types

type Factory added in v0.6.0

type Factory func(Options) (Speaker, error)

Factory builds a Speaker from its options.

type Options added in v0.6.0

type Options interface {
	Decode(v any) error
}

Options decodes a provider's config keys.

type Speaker

type Speaker interface {
	Speak(ctx context.Context, text string) ([]byte, error)
}

Speaker turns text into OGG/Opus audio, the usual voice-message format.

func NewCommand added in v0.6.0

func NewCommand(o Options) (Speaker, error)

NewCommand runs any program that writes speech to a file.

func NewHTTP added in v0.6.0

func NewHTTP(o Options) (Speaker, error)

NewHTTP posts text to an /audio/speech endpoint, the de facto standard API served by many hosted and self-hosted speech services.

func NewSay added in v0.6.0

func NewSay(o Options) (Speaker, error)

NewSay uses the macOS `say` command.

Jump to

Keyboard shortcuts

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