volcengine

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleSpeech

func HandleSpeech(c echo.Context, options mo.Option[types.SpeechRequestOptions]) mo.Result[any]

func ListVoices added in v0.1.12

func ListVoices(_ context.Context) ([]types.Voice, error)

ListVoices returns Volcengine's static voice catalogue embedded at build time. No credentials are required because the catalogue ships with the binary.

Types

type SpeechRequestOptions

type SpeechRequestOptions struct {
	App     SpeechRequestOptionsApp     `json:"app"`
	User    SpeechRequestOptionsUser    `json:"user"`
	Audio   SpeechRequestOptionsAudio   `json:"audio"`
	Request SpeechRequestOptionsRequest `json:"request"`
}

type SpeechRequestOptionsApp

type SpeechRequestOptionsApp struct {
	AppID   string `json:"appid"`
	Token   string `json:"token"`
	Cluster string `json:"cluster"`
}

type SpeechRequestOptionsAudio

type SpeechRequestOptionsAudio struct {
	VoiceType        string   `json:"voice_type"`
	Emotion          *string  `json:"emotion,omitempty"`
	EnableEmotion    *bool    `json:"enable_emotion,omitempty"`
	EmotionScale     *float64 `json:"emotion_scale,omitempty"`
	Encoding         *string  `json:"encoding,omitempty"`
	SpeedRatio       *float64 `json:"speed_ratio,omitempty"`
	Rate             *int     `json:"rate,omitempty"`
	BitRate          *int     `json:"bit_rate,omitempty"`
	ExplicitLanguage *string  `json:"explicit_language,omitempty"`
	ContextLanguage  *string  `json:"context_language,omitempty"`
	LoudnessRatio    *float64 `json:"loudness_ratio,omitempty"`
}

type SpeechRequestOptionsRequest

type SpeechRequestOptionsRequest struct {
	RequestID             string         `json:"reqid"`
	Text                  string         `json:"text"`
	TextType              *string        `json:"text_type,omitempty"`
	SilenceDuration       *float64       `json:"silence_duration,omitempty"`
	WithTimestamp         *string        `json:"with_timestamp,omitempty"`
	Operation             *string        `json:"operation,omitempty"`
	ExtraParam            *string        `json:"extra_param,omitempty"`
	DisableMarkdownFilter *bool          `json:"disable_markdown_filter,omitempty"`
	EnableLatexTone       *bool          `json:"enable_latex_tn,omitempty"`
	CacheConfig           map[string]any `json:"cache_config,omitempty"`
	UseCache              *bool          `json:"use_cache,omitempty"`
}

type SpeechRequestOptionsUser

type SpeechRequestOptionsUser struct {
	UserID string `json:"uid"`
}

type VoicesResponse

type VoicesResponse struct {
	Status string             `json:"status"`
	Error  any                `json:"error,omitempty"`
	Data   VoicesResponseData `json:"data"`
}

type VoicesResponseData

type VoicesResponseData struct {
	ResourcePacks []VoicesResponseDataResourcePack `json:"resource_packs"`
}

type VoicesResponseDataResourcePack

type VoicesResponseDataResourcePack struct {
	InstanceNumber    string                                `json:"instance_number"`
	IsShareable       bool                                  `json:"is_shareable"`
	ResourceID        string                                `json:"resource_id"`
	Code              string                                `json:"code"`
	ConfigurationCode string                                `json:"configuration_code"`
	ResourceDisplay   string                                `json:"resource_display"`
	RawType           string                                `json:"raw_type"`
	Type              string                                `json:"type"`
	PurchasedAmount   string                                `json:"purchased_amount"`
	CurrentUsage      string                                `json:"current_usage"`
	Expires           string                                `json:"expires"`
	Details           VoicesResponseDataResourcePackDetails `json:"details"`
	GroupName         string                                `json:"group_name"`
	Alias             string                                `json:"alias"`
	TrainID           string                                `json:"train_id"`
	State             string                                `json:"state"`
}

type VoicesResponseDataResourcePackDetails

type VoicesResponseDataResourcePackDetails struct {
	DemoLink            string `json:"demo_link"`
	Language            string `json:"language"`
	RecommendedScenario string `json:"recommended_scenario"`
	ToneNumber          string `json:"tone_number"`
	VoiceType           string `json:"voice_type"`
}

Jump to

Keyboard shortcuts

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