Merge pull request #10 from WorldObservationLog/main

fix: adapt lrc two digits ms standard
This commit is contained in:
zhaarey 2024-04-25 23:02:01 +08:00 committed by GitHub
commit 7cfde4b48d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -1256,7 +1256,8 @@ func conventTTMLToLRC(ttml string) (string, error) {
text = lyric.SelectAttr("text").Value
}
m += h * 60
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%03d]%s", m, s, ms, text))
ms = ms / 10
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%02d]%s", m, s, ms, text))
}
}
return strings.Join(lrcLines, "\n"), nil

View File

@ -1290,7 +1290,8 @@ func conventTTMLToLRC(ttml string) (string, error) {
text = lyric.SelectAttr("text").Value
}
m += h * 60
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%03d]%s", m, s, ms, text))
ms = ms / 10
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%02d]%s", m, s, ms, text))
}
}
return strings.Join(lrcLines, "\n"), nil

View File

@ -1290,7 +1290,8 @@ func conventTTMLToLRC(ttml string) (string, error) {
text = lyric.SelectAttr("text").Value
}
m += h * 60
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%03d]%s", m, s, ms, text))
ms = ms / 10
lrcLines = append(lrcLines, fmt.Sprintf("[%02d:%02d.%02d]%s", m, s, ms, text))
}
}
return strings.Join(lrcLines, "\n"), nil