chore: prepare for srt support + force sync lrc timestamp if timeline length mismatch

This commit is contained in:
CDN18 2024-09-27 20:39:48 +08:00
parent 6875b43b78
commit 00deeaf425
Signed by: CDN
GPG key ID: 0C656827F9F80080
2 changed files with 28 additions and 41 deletions

25
convert.go Normal file
View file

@ -0,0 +1,25 @@
package main
import (
"fmt"
"os"
)
func lrcToTxt(sourceFile, targetFile string) {
sourceLyrics, err := parseLyrics(sourceFile)
if err != nil {
fmt.Println("Error parsing source lyrics file:", err)
return
}
file, err := os.Create(targetFile)
if err != nil {
fmt.Println("Error creating target file:", err)
return
}
defer file.Close()
for _, content := range sourceLyrics.Content {
fmt.Fprintln(file, content)
}
}