Documentation
¶
Overview ¶
Package elevenlabs is used for handling communication with generative voice AI from https://elevenlabs.io/
Index ¶
Constants ¶
View Source
const MODEL_ID = "eleven_multilingual_v2" // AI models described here: https://docs.elevenlabs.io/speech-synthesis/models
View Source
const VOICE_ID = "pNInz6obpgDQGcFmaJgB" // Get other voice IDs here: https://docs.elevenlabs.io/api-reference/voices
Variables ¶
This section is empty.
Functions ¶
func DownloadAudio ¶
func DownloadAudio(ctx context.Context, params *SpeechRequest) error
DownloadAudio generates audio from text and saves the audio file as mp3 to disk.
func ServeAudio ¶
func ServeAudio(w http.ResponseWriter, req *http.Request)
ServeAudio generates audio from text and serves it as mpeg to the client.
func StreamAudio ¶
func StreamAudio(w http.ResponseWriter, req *http.Request)
StreamAudio generates audio from text and streams it as mpeg to the client.
Types ¶
type SpeechRequest ¶
type SpeechRequest struct {
Text string `json:"text"`
}
Click to show internal directories.
Click to hide internal directories.