ndspy.soundGroup
: Sound Groups¶
The ndspy.soundGroup
module contains classes and enumerations related to
sound groups.
A group is a collection of IDs of items that exist elsewhere in an SDAT file, which can be of different types. Games use groups to make lists of files that should be loaded together.
ndspy represents a group as a list
of GroupEntry
s.
See also
If you aren’t familiar with how SDAT files are structured, consider reading the appendix explaining this.
- class ndspy.soundGroup.GroupEntryType¶
- Base class:
An enumeration that distinguishes between the types of files that a group entry can refer to.
- SSEQ¶
The group entry refers to a SSEQ (sequence) file.
- SBNK¶
The group entry refers to a SBNK (instrument bank) file.
- SWAR¶
The group entry refers to a SWAR (wave archive) file.
- SSAR¶
The group entry refers to a SSAR (sequence archive) file.
- class ndspy.soundGroup.SWARLoadMethod¶
- Base class:
An enumeration that distinguishes between the ways in which a SWAR can be loaded.
Note
ndspy doesn’t expose raw SDAT file IDs, and that functionality seems to never really be used in practice (and there’s honestly no good reason to do so), so you don’t really need to worry about this very much.
- FILE_IDS¶
ndspy.soundBank.SBNK.waveArchiveIDs
contains raw SDAT file IDs.
- SWAR_IDs¶
ndspy.soundBank.SBNK.waveArchiveIDs
contains SWAR IDs.
- class ndspy.soundGroup.GroupEntry([type[, options[, id]]])¶
An entry in a sound group.
SSEQ group entries usually have
GroupEntry.loadSSEQ
andGroupEntry.loadSWAR
set toTrue
, andGroupEntry.SWARLoadMethod
set toSWARLoadMethod.SWAR_IDS
.SBNK group entries usually have
GroupEntry.loadSWAR
set toTrue
, andGroupEntry.SWARLoadMethod
set toSWARLoadMethod.SWAR_IDS
.SWAR group entries usually have
GroupEntry.loadSWAR
set toTrue
, andGroupEntry.SWARLoadMethod
set toSWARLoadMethod.SWAR_IDS
.SSAR group entries usually have
GroupEntry.loadSSAR
set toTrue
.- Parameters:
- loadSBNKSWARsFrom¶
This attribute determines how SWAR IDs in an SBNK (see:
ndspy.soundBank.SBNK.waveArchiveIDs
) will be interpreted – either as raw SDAT file IDs or as SWAR IDs.Note
ndspy doesn’t expose raw SDAT file IDs, and this functionality seems to never really be used in practice (and there’s honestly no good reason to do so), so you don’t really need to worry about this very much.
Note
This value hasn’t been tested; the explanation here is based on reverse-engineeered code. If you test it, please send a PR to update this documentation with your findings!
- Type:
- Default:
SWARLoadMethod.SWAR_IDS
- type¶
The type of file the group entry refers to.
- Type:
- Default:
- classmethod fromFlags(type, id[, loadSSEQ[, loadSBNKSWARsFrom[, loadSWAR[, loadSSAR]]]])¶
Create a sound group entry from individual attribute values.
- Parameters:
type – The initial value for the
type
attribute.id – The initial value for the
id
attribute.loadSSEQ – The initial value for the
loadSSEQ
attribute.loadSBNKSWARsFrom – The initial value for the
loadSBNKSWARsFrom
attribute.loadSWAR – The initial value for the
loadSWAR
attribute.loadSSAR – The initial value for the
loadSSAR
attribute.
- Returns:
The sound group entry object.
- Return type: