From 1ebe698ac4967479d5be295bf2a35f214328983e Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 6 Sep 2025 22:45:33 -0400 Subject: [PATCH] [rom] Add NoAudio option to export Added an option to exclude the audio file from the unpacked rom data. --- rom/export.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rom/export.go b/rom/export.go index af7444c..7716eeb 100644 --- a/rom/export.go +++ b/rom/export.go @@ -6,7 +6,7 @@ import ( "os" ) -func (sb *StudyBox) Export(directory string) error { +func (sb *StudyBox) Export(directory string, includeAudio bool) error { sbj := StudyBoxJson{ Version: 1, Pages: []jsonPage{}, @@ -133,9 +133,11 @@ func (sb *StudyBox) Export(directory string) error { return fmt.Errorf("Missing audio!") } - err := sb.Audio.WriteToFile(directory + "/audio") - if err != nil { - return fmt.Errorf("Error writing audio file: %v", err) + if includeAudio { + err := sb.Audio.WriteToFile(directory + "/audio") + if err != nil { + return fmt.Errorf("Error writing audio file: %v", err) + } } rawJson, err := json.MarshalIndent(sbj, "", " ")