Skip to content

Commit

Permalink
removed carriage return error when parsing timestamps on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Spawn committed Dec 3, 2023
1 parent 4ab0463 commit db4f8ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions align.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ func parseTimestamps(timestampsPath string) []Timestamp {
var timestamps []Timestamp
for _, l := range lines {
parts := strings.Split(l, " ")
parts[len(parts)-1] = strings.TrimSuffix(parts[len(parts)-1], "\r")
var newStamp Timestamp
time, err := strconv.Atoi(parts[0])
if err != nil {
fmt.Println("Error parsing int in Timestamps file:", parts[0])
log.Fatal(err)
}
fmt.Println(len(parts[0]), len(parts[1]))
newStamp.Time = uint32(time)
newStamp.Name = parts[1]
if len(parts) > 2 {
Expand Down
7 changes: 3 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ func main() {
}

logM(3, "Args:", args)

logM(1, "Parsing Timestamps...")
timestamps := parseTimestamps(args.Timestamps)
logM(2, "Timestamps:", timestamps)
var text string
if !args.SkipTranscriber {
logM(1, "Transcribing Audio...")
Expand All @@ -51,9 +53,6 @@ func main() {
}
logM(3, gentleResponse)

logM(1, "Parsing Timestamps...")
timestamps := parseTimestamps(args.Timestamps)
logM(2, "Timestamps:", timestamps)
genImageSequence(
VideoRequest{
gentleResponse,
Expand Down
2 changes: 1 addition & 1 deletion videoGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type Pose struct {
func getPose(poseName string, character *jsonq.JsonQuery, characterDir string) Pose {
p, e := character.Object("poses", poseName)
if e != nil {
fmt.Println("Error getting pose ", poseName)
fmt.Println("Error getting pose:", poseName)
log.Fatal(e)
}
var pose Pose
Expand Down

0 comments on commit db4f8ce

Please sign in to comment.