Documentation
¶
Overview ¶
Package hume wraps Hume AI's TTS API.
NewSpeechModel targets Hume's /v0/tts endpoint backed by the Octave voice model — Hume's pitch is emotion-aware synthesis driven by acting / description prompts in addition to plain text.
Provider-specific description, voice.provider, trailing_silence, format details, timestamps, and instant_mode use SpeechRequestExtensionKey. One utterance may carry these controls; Core owns its text, voice ID, speed, and output format. speech.Options.Model selects the official Octave protocol version ("1" or "2"). NewStreamingSpeechModel exposes streaming separately through Hume's newline-delimited /v0/tts/stream/json endpoint. Timestamp output belongs to unary synthesis; instant_mode belongs to streaming synthesis.
Hume's broader expression-measurement APIs (face / voice / language emotion analysis) aren't exposed — they don't fit Core speech and transcription interfaces.
See https://dev.hume.ai/docs for the full reference. Each /tts/stream/json NDJSON event must fit within Core's httpclient.DefaultMaxJSONResponseBytes before JSON or base64 decoding. This frame budget does not impose a total byte limit on a healthy audio stream.
Index ¶
Constants ¶
const ( SpeechRequestExtensionKey = Provider + "/speech_request" DefaultBaseURL = "https://api.hume.ai/v0" )
const ( ModelOctave1 = "1" ModelOctave2 = "2" )
const (
Provider = "hume"
)
Provider is the stable backend name for host-side attribution.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpeechModel ¶ added in v0.41.0
type SpeechModel struct {
// contains filtered or unexported fields
}
SpeechModel wraps Hume's Octave TTS (/v0/tts). Hume's headline feature is emotion-aware synthesis driven by per-utterance "description" cues — those live on the extension-threaded provider request.
speech.Options.Voice maps onto a voice ID; voice.provider defaults to HUME_AI and may be set through SpeechRequestExtensionKey. speech.Options.Model selects the official Octave version ("1" or "2").
func NewSpeechModel ¶ added in v0.41.0
func NewSpeechModel(ctx context.Context, config SpeechModelConfig) (*SpeechModel, error)
type SpeechModelConfig ¶ added in v0.41.0
type SpeechModelConfig struct {
APIKey string
DefaultOptions speech.Options
BaseURL string
HTTPClient *http.Client
}
func (SpeechModelConfig) Validate ¶ added in v0.41.0
func (s SpeechModelConfig) Validate() error
type StreamingSpeechModel ¶ added in v0.41.0
type StreamingSpeechModel struct {
// contains filtered or unexported fields
}
func NewStreamingSpeechModel ¶ added in v0.41.0
func NewStreamingSpeechModel(ctx context.Context, config SpeechModelConfig) (*StreamingSpeechModel, error)