Versions in this module Expand all Collapse all v1 v1.3.0 Jun 8, 2026 Changes in this version type SubmitAudioRequest + TrainText string type VolcengineCloneConfig + ModelType int + ResourceID string v1.2.0 Jun 6, 2026 Changes in this version + const VolcengineCloneCluster + type AuthToken struct + AccessToken string + ExpiresIn string + RetCode string + type Config struct + Options map[string]interface{} + Provider Provider + type CreateTaskRequest struct + AgeGroup int + Denoise int + EngineVersion string + Language string + MosRatio float64 + ResourceType int + Sex int + TaskName string + type CreateTaskResponse struct + TaskID string + type Factory struct + func NewFactory() *Factory + func (f *Factory) CreateService(config *Config) (VoiceCloneService, error) + func (f *Factory) CreateServiceFromJSON(jsonConfig string) (VoiceCloneService, error) + func (f *Factory) GetSupportedProviders() []Provider + func (f *Factory) ValidateConfig(config *Config) error + type Provider string + const ProviderVolcengine + const ProviderXunfei + type SentenceTimestamp struct + EndTime int64 + StartTime int64 + type SubmitAudioRequest struct + AudioFile io.Reader + Language string + MosRatio float64 + TaskID string + TextID int64 + TextSegID int64 + type SynthesisHandler interface + OnMessage func([]byte) + OnTimestamp func(timestamp SentenceTimestamp) + type SynthesizeRequest struct + AssetID string + Language string + LanguageID *int + Style string + Text string + type SynthesizeResponse struct + AudioData []byte + Duration float64 + Format string + SampleRate int + type TaskStatus struct + AssetID string + CreatedAt time.Time + FailedDesc string + Progress float64 + Status TrainingStatus + TaskID string + TaskName string + TrainVID string + UpdatedAt time.Time + type TextSegment struct + SegID interface{} + SegText string + type TrainingStatus int + const TrainingStatusFailed + const TrainingStatusInProgress + const TrainingStatusQueued + const TrainingStatusSuccess + type TrainingText struct + Segments []TextSegment + TextID int64 + TextName string + type VoiceCloneService interface + CreateTask func(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) + GetTrainingTexts func(ctx context.Context, textID int64) (*TrainingText, error) + Provider func() Provider + QueryTaskStatus func(ctx context.Context, taskID string) (*TaskStatus, error) + SubmitAudio func(ctx context.Context, req *SubmitAudioRequest) error + Synthesize func(ctx context.Context, req *SynthesizeRequest) (*SynthesizeResponse, error) + SynthesizeStream func(ctx context.Context, req *SynthesizeRequest, handler SynthesisHandler) error + type VoiceCloneSynthesisService struct + func NewVoiceCloneSynthesisService(cloneService VoiceCloneService, assetID string) *VoiceCloneSynthesisService + func (v *VoiceCloneSynthesisService) CacheKey(text string) string + func (v *VoiceCloneSynthesisService) Close() error + func (v *VoiceCloneSynthesisService) Format() map[string]interface{} + func (v *VoiceCloneSynthesisService) Provider() string + func (v *VoiceCloneSynthesisService) Synthesize(ctx context.Context, handler interface{}, text string) error + type VolcAddition struct + Frontend string + type VolcengineCloneConfig struct + AppID string + BitDepth int + Channels int + Cluster string + Encoding string + FrameDuration string + SampleRate int + SpeedRatio float64 + Token string + TrainingTimes int + VoiceType string + type VolcengineCloneService struct + func NewVolcengineCloneService(config VolcengineCloneConfig) *VolcengineCloneService + func (s *VolcengineCloneService) CreateTask(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) + func (s *VolcengineCloneService) GetTrainingTexts(ctx context.Context, textID int64) (*TrainingText, error) + func (s *VolcengineCloneService) Provider() Provider + func (s *VolcengineCloneService) QueryTaskStatus(ctx context.Context, taskID string) (*TaskStatus, error) + func (s *VolcengineCloneService) SubmitAudio(ctx context.Context, req *SubmitAudioRequest) error + func (s *VolcengineCloneService) Synthesize(ctx context.Context, req *SynthesizeRequest) (*SynthesizeResponse, error) + func (s *VolcengineCloneService) SynthesizeStream(ctx context.Context, req *SynthesizeRequest, handler SynthesisHandler) error + type VolcengineResponse struct + Audio []byte + ErrorCode int + ErrorMessage string + HeaderSize int + IsLast bool + MessageCompression int + MessageType int + MessageTypeSpecificFlags int + PayloadSize int + ProtocolVersion int + Reserved int + SequenceNumber int + SerializationMethod int + Timestamp *VolcengineSentenceTimestamp + type VolcengineSentenceTimestamp struct + Words []Word + type Word struct + Confidence float64 + EndTime int + StartTime int + Word string + type XunfeiCloneConfig struct + APIKey string + AppID string + BaseURL string + EngineVersion string + Timeout int + VCN string + WebSocketAPIKey string + WebSocketAPISecret string + WebSocketAppID string + type XunfeiCloneService struct + func NewXunfeiCloneService(config XunfeiCloneConfig) *XunfeiCloneService + func (s *XunfeiCloneService) CreateTask(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) + func (s *XunfeiCloneService) GetTrainingTexts(ctx context.Context, textID int64) (*TrainingText, error) + func (s *XunfeiCloneService) Provider() Provider + func (s *XunfeiCloneService) QueryTaskStatus(ctx context.Context, taskID string) (*TaskStatus, error) + func (s *XunfeiCloneService) SubmitAudio(ctx context.Context, req *SubmitAudioRequest) error + func (s *XunfeiCloneService) Synthesize(ctx context.Context, req *SynthesizeRequest) (*SynthesizeResponse, error) + func (s *XunfeiCloneService) SynthesizeStream(ctx context.Context, req *SynthesizeRequest, handler SynthesisHandler) error