Documentation
¶
Overview ¶
Package tts adds Text-to-Speech to togo. Drivers (elevenlabs, openai, …) register via init(); select one with TTS_DRIVER. Mirrors the ai plugin's driver pattern, so adding a provider is one self-contained driver. Mount the REST handler under /api/ai/tts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler exposes the TTS service over REST. Mount under /api/ai/tts in your app:
mux.Handle("/api/ai/tts/", http.StripPrefix("/api/ai/tts", tts.Handler(k)))
POST / with a JSON Request -> raw audio (audio/mpeg or audio/wav).
func RegisterDriver ¶
func RegisterDriver(name string, f DriverFactory)
RegisterDriver registers a TTS driver (called from init()).
Types ¶
type DriverFactory ¶
DriverFactory builds a Provider from the kernel/env.
type Request ¶
type Request struct {
Text string `json:"text"`
Voice string `json:"voice,omitempty"` // provider voice id/name
Model string `json:"model,omitempty"` // provider model
Format string `json:"format,omitempty"` // mp3 (default) | wav
}
Request is a synthesis request.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the kernel-bound TTS service.
func FromKernel ¶
FromKernel returns the TTS service bound to the kernel.
Click to show internal directories.
Click to hide internal directories.