hume

package module
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

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

View Source
const (
	SpeechRequestExtensionKey = Provider + "/speech_request"
	DefaultBaseURL            = "https://api.hume.ai/v0"
)
View Source
const (
	ModelOctave1 = "1"
	ModelOctave2 = "2"
)
View Source
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)

func (*SpeechModel) Call added in v0.41.0

func (s *SpeechModel) Call(ctx context.Context, req *speech.Request) (*speech.Response, 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)

func (*StreamingSpeechModel) Stream added in v0.41.0

Jump to

Keyboard shortcuts

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