Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

fix: transcription error when use aliyun

沈浩4f38096573aa
diff --git a/pkg/aliyun/asr.go b/pkg/aliyun/asr.go
index 9577ec3f..c071a465 100644
--- a/pkg/aliyun/asr.go
+++ b/pkg/aliyun/asr.go
@@ -7,6 +7,7 @@ import (
"github.com/gorilla/websocket"
"go.uber.org/zap"
"io"
+ "krillin-ai/internal/storage"
"krillin-ai/internal/types"
"krillin-ai/log"
"net/http"
@@ -154,7 +155,7 @@ type Event struct {
func processAudio(filePath string) (string, error) {
dest := strings.ReplaceAll(filePath, filepath.Ext(filePath), "_mono_16K.mp3")
cmdArgs := []string{"-i", filePath, "-ac", "1", "-ar", "16000", "-b:a", "192k", dest}
- cmd := exec.Command("ffmpeg", cmdArgs...)
+ cmd := exec.Command(storage.FfmpegPath, cmdArgs...)
output, err := cmd.CombinedOutput()
if err != nil {
log.GetLogger().Error("处理音频失败", zap.Error(err), zap.String("audio file", filePath), zap.String("output", string(output)))