Skip to content

Commit

Permalink
Dubbing: Merge more words if in small duration. v5.15.17
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jul 19, 2024
1 parent c1e316f commit 1bf2774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ The following are the update records for the Oryx server.
* Support Go PPROF for CPU profiling. [v5.15.15](https://github.com/ossrs/oryx/releases/tag/v5.15.15)
* VLive: Support download by youtube-dl. v5.15.16
* Dubbing: Use gpt-4o and smaller ASR segment. v5.15.17
* Dubbing: Merge more words if in small duration. v5.15.17
* v5.14:
* Merge features and bugfix from releases. v5.14.1
* Dubbing: Support VoD dubbing for multiple languages. [v5.14.2](https://github.com/ossrs/oryx/releases/tag/v5.14.2)
Expand Down
7 changes: 5 additions & 2 deletions platform/dubbing.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var aiDubbingWorkDir = "containers/data/dubbing"
// MergeSegmentBetweenGroups is used for detect the gap for automatically merging.
const MergeSegmentBetweenGroups = 10 * time.Millisecond

// MergeSegmentForSmallWords is used for merging the group if less than this words.
const MergeSegmentForSmallWords = 30

// For production, all should be false.
const (
alwaysForceRegenerateASRResponse = false
Expand Down Expand Up @@ -1904,9 +1907,9 @@ func (v *SrsDubbingTask) Start(ctx context.Context) error {

// Whether the next segment is very few words.
if isEnglish(nextText) {
nextFewWords = strings.Count(nextText, " ") < 5
nextFewWords = strings.Count(nextText, " ") < MergeSegmentForSmallWords
} else {
nextFewWords = utf8.RuneCount([]byte(nextText)) < 5
nextFewWords = utf8.RuneCount([]byte(nextText)) < MergeSegmentForSmallWords
}
}

Expand Down

0 comments on commit 1bf2774

Please sign in to comment.