Documentation
¶
Overview ¶
elevenlabs implements an API client for elevenlabs (https://elevenlabs.io/docs/api-reference/text-to-speech)
Index ¶
- type Client
- func (c *Client) Models() ([]Model, error)
- func (c *Client) SetVoiceSettings(Id string, v VoiceSettings) error
- func (c *Client) TextToSpeech(w io.Writer, voice, text string, opts ...Opt) (int64, error)
- func (c *Client) Voice(Id string) (Voice, error)
- func (c *Client) VoiceSettings(Id string) (VoiceSettings, error)
- func (c *Client) Voices() ([]Voice, error)
- type Model
- type Opt
- type Voice
- type VoiceSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*client.Client
}
func (*Client) SetVoiceSettings ¶ added in v1.0.4
func (c *Client) SetVoiceSettings(Id string, v VoiceSettings) error
Set voice settings for a voice
func (*Client) TextToSpeech ¶ added in v0.0.3
Converts text into speech, returning the number of bytes written to the writer
func (*Client) VoiceSettings ¶ added in v1.0.4
func (c *Client) VoiceSettings(Id string) (VoiceSettings, error)
Return voice settings. If Id is empty, then return the default voice settings
type Model ¶ added in v1.0.4
type Model struct {
Id string `json:"model_id" writer:",width:30"`
Name string `json:"name" writer:",width:30,wrap"`
Description string `json:"description,omitempty" writer:",wrap"`
CanBeFineTuned bool `json:"can_be_fine_tuned" writer:",width:5"`
CanDoTextToSpeech bool `json:"can_do_text_to_speech" writer:",width:5"`
CanDoVoiceConversion bool `json:"can_do_voice_conversion" writer:",width:5"`
CanUseStyle bool `json:"can_use_style" writer:",width:5"`
CanUseSpeakerBoost bool `json:"can_use_speaker_boost" writer:",width:5"`
ServesProVoices bool `json:"serves_pro_voices" writer:",width:5"`
TokenCostFactor float32 `json:"token_cost_factor" writer:",width:5,right"`
RequiresAlphaAccess bool `json:"requires_alpha_access,omitempty" writer:",width:5"`
Languages []struct {
Id string `json:"language_id"`
Name string `json:"name"`
} `json:"languages,omitempty" writer:",wrap"`
}
type Opt ¶ added in v0.0.3
type Opt func(*opts) error
Opt is a function which can be used to set options on a request
func OptFormatMP3 ¶ added in v1.0.4
Set the output format to MP3 given bitrate and samplerate
func OptFormatPCM ¶ added in v1.0.4
Set the output format to PCM
type Voice ¶ added in v0.0.3
type Voice struct {
Id string `json:"voice_id" writer:",width:20"`
Name string `json:"name"`
Description string `json:"description,omitempty" writer:",wrap"`
PreviewUrl string `json:"preview_url,omitempty" writer:",width:40,wrap"`
Category string `json:"category,omitempty" writer:",width:10"`
Samples []struct {
Id string `json:"sample_id"`
Filename string `json:"file_name"`
MimeType string `json:"mime_type"`
Size int64 `json:"size_bytes"`
Hash string `json:"hash"`
} `json:"samples,omitempty" writer:"samples,wrap"`
Settings VoiceSettings `json:"settings" writer:"settings,wrap,width:20"`
}
Click to show internal directories.
Click to hide internal directories.