Documentation
¶
Overview ¶
Package volcvoice implements engine.Engine for Volcengine Speech (火山语音 / openspeech.bytedance.com) TTS and ASR.
TTS uses POST /api/v1/tts with voice_type and encoding parameters. ASR uses POST /api/v1/asr with audio data in base64.
Authentication requires an AppID and Access Token, which can be set via Config or environment variables VOLC_SPEECH_APPID and VOLC_SPEECH_ACCESS_TOKEN.
Index ¶
Constants ¶
const ( // TTS models (voice_type values). ModelTTSMega = "volcano_mega" // 大模型语音合成 ModelTTSIcl = "volcano_icl" // 复刻音色 ModelTTSDefault = "volcano_tts" // 通用语音合成 ModelASR = "volcano_asr" // 语音识别 ModelASRLarge = "volcano_asr_pro" // 语音识别 Pro )
Model constants for TTS and ASR.
Variables ¶
var ( ErrMissingAppID = errors.New("volcvoice: missing AppID (set Config.AppID or VOLC_SPEECH_APPID)") ErrMissingText = errors.New("volcvoice: missing text for TTS (set prompt)") ErrMissingAudioURL = errors.New("volcvoice: missing audio_url for ASR") ErrMissingVoice = errors.New("volcvoice: missing voice (set voice option)") )
Functions ¶
func ConfigSchema ¶
func ConfigSchema() []engine.ConfigField
ConfigSchema returns the configuration fields required by the Volcengine Speech engine.
func DefaultProvider ¶ added in v0.15.0
DefaultProvider returns preset engine configurations for volcvoice.
func ModelInfos ¶ added in v0.16.0
ModelInfos returns i18n metadata for all Volcengine Speech models.
func ModelsByCapability ¶
ModelsByCapability returns all known Volcengine Speech models grouped by capability.
Types ¶
type Config ¶
type Config struct {
AppID string // Volcengine Speech AppID
AccessToken string // Access token for authentication
BaseURL string // e.g. "https://openspeech.bytedance.com"
Model string // Model identifier, e.g. "volcano_mega"
Cluster string // TTS cluster override (default: auto-detected)
HTTPClient *http.Client
}
Config configures the Volcengine Speech engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine implements engine.Engine for Volcengine Speech TTS/ASR.
func (*Engine) Capabilities ¶
func (e *Engine) Capabilities() engine.Capability
Capabilities implements engine.Describer.