tts

package
v0.0.0-...-0de386a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknown               = errors.New("unknown error")
	ErrNoResponse            = errors.New("no response")
	ErrInvalidRequest        = errors.New("invalid request")
	ErrInvalidResponse       = errors.New("invalid response")
	ErrAuthentication        = errors.New("authentication error")
	ErrPermission            = errors.New("permission error")
	ErrNotFound              = errors.New("not found")
	ErrRateLimit             = errors.New("rate limit error")
	ErrOverloaded            = errors.New("overloaded")
	ErrInternalServer        = errors.New("internal server error")
	ErrUnprocessableContent  = errors.New("unprocessable content")
	ErrUnsupportedFileFormat = errors.New("unsupported file format")
)

Functions

This section is empty.

Types

type AudioFile

type AudioFile struct {
	Format Format `json:"mime"`
	Data   []byte `json:"data"`
}

type Config

type Config struct {
	Language string
	Model    string

	SpeakingRate float64
	Pitch        float64
	SampleRate   int

	Format Format

	VoiceID         string
	Stability       float64
	SimilarityBoost float64
	Style           int
	UseSpeakerBoost bool
	Seed            int

	PronunciationDictLocs []struct {
		PronunciationDictionaryID string
		VersionID                 string
	}
}

type Format

type Format string
const (
	FormatLINEAR16 Format = "audio/l16"
	FormatMP3      Format = "audio/mpeg"
	FormatOGG      Format = "audio/ogg"
	FormatALAW     Format = "audio/alaw"
	FormatMULAW    Format = "audio/mulaw"
	FormatAAC      Format = "audio/aac"
	FormatFLAC     Format = "audio/flac"
	FormatWAV      Format = "audio/wav"
)

type Model

type Model interface {
	GenerateSpeech(ctx context.Context, text string) (*AudioFile, error)
}

Jump to

Keyboard shortcuts

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