[rom] Add NoAudio option to export
Added an option to exclude the audio file from the unpacked rom data.
This commit is contained in:
parent
5a001931e7
commit
1ebe698ac4
|
@ -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,10 +133,12 @@ func (sb *StudyBox) Export(directory string) error {
|
|||
return fmt.Errorf("Missing audio!")
|
||||
}
|
||||
|
||||
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, "", " ")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue