chore: prepare for srt support + force sync lrc timestamp if timeline length mismatch
This commit is contained in:
parent
6875b43b78
commit
00deeaf425
2 changed files with 28 additions and 41 deletions
25
convert.go
Normal file
25
convert.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue