Skip to content

Commit

Permalink
feat: rename huoshan to Volcengine
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong <[email protected]>
  • Loading branch information
cubxxw committed Nov 1, 2024
1 parent 6660864 commit 41156e8
Showing 5 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
# VOLCENGINE 配置
VOICEFLOW_VOLCENGINE_ACCESS_KEY=''
VOICEFLOW_VOLCENGINE_APP_KEY=''
VOICEFLOW_VOLCENGINE_WS_URL='wss://openspeech.bytedance.com/api/v3/sauc/bigmode
4 changes: 2 additions & 2 deletions configs/config.yaml
Original file line number Diff line number Diff line change
@@ -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: ''
6 changes: 3 additions & 3 deletions internal/stt/stt.go
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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,
}
}

6 changes: 3 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -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"`

0 comments on commit 41156e8

Please sign in to comment.