diff --git a/.env.example b/.env.example index 2ee1186..44ea8fd 100644 --- a/.env.example +++ b/.env.example @@ -21,7 +21,7 @@ VOICEFLOW_ASSEMBLYAI_API_KEY='your_assemblyai_api_key' # AssemblyAI API 密钥 # 语音服务端口配置 VOICEFLOW_SERVER_PORT=18080 # VoiceFlow 服务端口 -# Huoshan 配置 -VOICEFLOW_HUOSHAN_ACCESS_KEY='' -VOICEFLOW_HUOSHAN_APP_KEY='' -VOICEFLOW_HUOSHAN_WS_URL='wss://openspeech.bytedance.com/api/v3/sauc/bigmode \ No newline at end of file +# VOLCENGINE 配置 +VOICEFLOW_VOLCENGINE_ACCESS_KEY='' +VOICEFLOW_VOLCENGINE_APP_KEY='' +VOICEFLOW_VOLCENGINE_WS_URL='wss://openspeech.bytedance.com/api/v3/sauc/bigmode \ No newline at end of file diff --git a/configs/config.yaml b/configs/config.yaml index 64919cc..48c3e8c 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -14,7 +14,7 @@ minio: secure: true # 如果需要使用 HTTPS 连接,设置为 true stt: - provider: huoshan # 可选值:azure、google、local、assemblyai、huoshan + provider: volcengine # 可选值:azure、google、local、assemblyai、volcengine tts: provider: google # 可选值:azure、google、local @@ -39,7 +39,7 @@ openai: # OPENAI_BASE_URL='https://api.chatanywhere.tech' # Domestic version base_url: "" -huoshan: +volcengine: access_key: '' app_key: '' ws_url: '' diff --git a/internal/stt/stt.go b/internal/stt/stt.go index 33de117..4894019 100644 --- a/internal/stt/stt.go +++ b/internal/stt/stt.go @@ -5,8 +5,8 @@ import ( "github.com/telepace/voiceflow/internal/stt/assemblyai" "github.com/telepace/voiceflow/internal/stt/azure" "github.com/telepace/voiceflow/internal/stt/google" - "github.com/telepace/voiceflow/internal/stt/huoshan" "github.com/telepace/voiceflow/internal/stt/local" + "github.com/telepace/voiceflow/internal/stt/volcengine" "github.com/telepace/voiceflow/pkg/logger" ) @@ -25,8 +25,8 @@ func NewService(provider string) Service { return google.NewGoogleSTT() case "assemblyai": return assemblyai.NewAssemblyAI() - case "huoshan": - return huoshan.NewHuoshanSTT() + case "volcengine": + return volcengine.NewVolcengineSTT() case "local": return local.NewLocalSTT() default: diff --git a/internal/stt/huoshan/huoshan.go b/internal/stt/volcengine/huoshan.go similarity index 95% rename from internal/stt/huoshan/huoshan.go rename to internal/stt/volcengine/huoshan.go index 65a6abd..920876b 100644 --- a/internal/stt/huoshan/huoshan.go +++ b/internal/stt/volcengine/huoshan.go @@ -1,5 +1,5 @@ -// huoshan.go -package huoshan +// volcengine.go +package volcengine import ( "bytes" @@ -27,21 +27,21 @@ type STT struct { appKey string } -func NewHuoshanSTT() *STT { +func NewVolcengineSTT() *STT { cfg, err := config.GetConfig() if err != nil { logger.Fatalf("配置初始化失败: %v", err) } return &STT{ - wsURL: cfg.Huoshan.WsURL, - uid: cfg.Huoshan.UID, - rate: cfg.Huoshan.Rate, - format: cfg.Huoshan.Format, - bits: cfg.Huoshan.Bits, - channel: cfg.Huoshan.Channel, - codec: cfg.Huoshan.Codec, - accessKey: cfg.Huoshan.AccessKey, - appKey: cfg.Huoshan.AppKey, + wsURL: cfg.Volcengine.WsURL, + uid: cfg.Volcengine.UID, + rate: cfg.Volcengine.Rate, + format: cfg.Volcengine.Format, + bits: cfg.Volcengine.Bits, + channel: cfg.Volcengine.Channel, + codec: cfg.Volcengine.Codec, + accessKey: cfg.Volcengine.AccessKey, + appKey: cfg.Volcengine.AppKey, } } diff --git a/pkg/config/config.go b/pkg/config/config.go index e55bc0d..de51d6f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -7,7 +7,7 @@ import ( "sync" ) -type HuoshanConfig struct { +type VolcengineConfig struct { AccessKey string `mapstructure:"access_key"` AppKey string `mapstructure:"app_key"` WsURL string `mapstructure:"ws_url"` @@ -52,8 +52,8 @@ type Config struct { STTKey string `mapstructure:"stt_key"` Region string } - Huoshan HuoshanConfig `yaml:"huoshan"` - MinIO struct { + Volcengine VolcengineConfig `yaml:"volcengine"` + MinIO struct { Enabled bool `mapstructure:"enabled"` BucketName string `mapstructure:"bucket_name"` Endpoint string `mapstructure:"endpoint"`