ndspy.soundWaveArchive
: Sound Wave Archives¶
The ndspy.soundWaveArchive
module lets you edit and create SWAR files,
which are essentially just slightly glorified lists of SWAV files.
See also
If you aren’t familiar with how SDAT files are structured, consider reading the appendix explaining this.
Documentation about the SWAV files within SWARs can be found on the ndspy.soundWave: Sound Waves page.
- class ndspy.soundWaveArchive.SWAR([file[, unk02]])¶
A SWAR sound wave archive.
- Parameters:
- dataMergeOptimizationID¶
When saving a SDAT file containing multiple SWAR files, ndspy will check if any of them save to identical data. If it finds any, it will only encode the data for them once and then reference it multiple times, to save some space. This attribute is an extra field that is also compared between SWAR files, which you can use to exclude particular ones from this optimization.
Since this defaults to 0 for all SWARs created from scratch, this optimization will happen by default. It’s unlikely that you will need to use this attribute to disable the optimization, but you can.
Note
This value is not explicitly saved in the SWAR file or in the SDAT file containing it.
- Type:
- Default:
0
- unk02¶
The value following the SWAR’s file ID in the “INFO” section of the SDAT file it is contained in. Its purpose is unknown.
Note
This value is not explicitly saved in the SWAR file, but it is saved in the SDAT file if the SWAR is within one.
- Type:
- Default:
0
- waves¶
The SWAV objects contained in this SWAR. “Wave IDs” or “SWAV IDs” are simply indices into this list.
- Type:
- Default:
[]
- classmethod fromWaves(waves[, unk02])¶
Create a SWAR from a list of SWAVs.
- classmethod fromFile(filePath[, unk02])¶
Load a SWAR from a filesystem file. This is a convenience function.