[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"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (sb *StudyBox) Export(directory string) error {
|
func (sb *StudyBox) Export(directory string, includeAudio bool) error {
|
||||||
sbj := StudyBoxJson{
|
sbj := StudyBoxJson{
|
||||||
Version: 1,
|
Version: 1,
|
||||||
Pages: []jsonPage{},
|
Pages: []jsonPage{},
|
||||||
|
@ -133,10 +133,12 @@ func (sb *StudyBox) Export(directory string) error {
|
||||||
return fmt.Errorf("Missing audio!")
|
return fmt.Errorf("Missing audio!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if includeAudio {
|
||||||
err := sb.Audio.WriteToFile(directory + "/audio")
|
err := sb.Audio.WriteToFile(directory + "/audio")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error writing audio file: %v", err)
|
return fmt.Errorf("Error writing audio file: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rawJson, err := json.MarshalIndent(sbj, "", " ")
|
rawJson, err := json.MarshalIndent(sbj, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue