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.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
subtitle fix
wulien68eda3d9e9f8
diff --git a/internal/service/audio2subtitle.go b/internal/service/audio2subtitle.goindex 7c5ff702..74ca4e20 100644--- a/internal/service/audio2subtitle.go+++ b/internal/service/audio2subtitle.go@@ -5,8 +5,6 @@ import ("context""errors""fmt"- "go.uber.org/zap"- "golang.org/x/sync/errgroup""krillin-ai/config""krillin-ai/internal/storage""krillin-ai/internal/types"@@ -17,6 +15,9 @@ import ("path/filepath""strings""sync"++ "go.uber.org/zap"+ "golang.org/x/sync/errgroup")func (s Service) audioToSubtitle(ctx context.Context, stepParam *types.SubtitleTaskStepParam) error {@@ -656,8 +657,9 @@ func (s Service) generateTimestamps(taskId, basePath string, originLanguage type}i := 1+ nextStart := truefor _, word := range sentenceWords {- if i == 1 || i%(originLanguageWordOneLine+1) == 0 {+ if nextStart {startWord = wordif startWord.Start < endWord.End {startWord.Start = endWord.End@@ -669,6 +671,7 @@ func (s Service) generateTimestamps(taskId, basePath string, originLanguage typeendWord = startWordoriginSentence += word.Text + " "i+++ nextStart = falsecontinue}@@ -688,6 +691,7 @@ func (s Service) generateTimestamps(taskId, basePath string, originLanguage typeOriginLanguageSentence: originSentence,})originSentence = ""+ nextStart = true}i++}