Beat Saber Open Replay format parser written in Go
Disclaimer: This is my Go learning project, so expect bugs and ugly code
go get -u github.com/motzel/go-bsor
path := "replays/hellfire.bsor"
file, err := os.Open(path)
if err != nil {
log.Fatal("Can not open file: ", err)
}
defer file.Close()
var replay *bsor.Bsor
if replay, err = bsor.Read(file); err != nil {
log.Fatal("Replay decode: ", err)
}
fmt.Printf("BSOR version: %v\n", replay.Header.Version)
fmt.Printf("BSOR Info: %+v\n", replay.Info)
fmt.Printf("BSOR Frames: %v\n", len(replay.Frames))
fmt.Printf("BSOR Notes: %v\n", len(replay.Notes))
fmt.Printf("BSOR Walls: %v\n", len(replay.Walls))
fmt.Printf("BSOR Heights: %v\n", len(replay.Heights))
fmt.Printf("BSOR Pauses: %v\n", len(replay.Pauses))