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 GroupEntrys.
See also
If you aren’t familiar with how SDAT files are structured, consider reading the appendix explaining this.
-
class
ndspy.soundGroup.GroupEntryType[source]¶ Base class: enum.IntEnumAn 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[source]¶ Base class: enum.IntEnumAn 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.waveArchiveIDscontains raw SDAT file IDs.
-
SWAR_IDs¶ ndspy.soundBank.SBNK.waveArchiveIDscontains SWAR IDs.
-
-
class
ndspy.soundGroup.GroupEntry([type[, options[, id]]])[source]¶ An entry in a sound group.
SSEQ group entries usually have
GroupEntry.loadSSEQandGroupEntry.loadSWARset toTrue, andGroupEntry.SWARLoadMethodset toSWARLoadMethod.SWAR_IDS.SBNK group entries usually have
GroupEntry.loadSWARset toTrue, andGroupEntry.SWARLoadMethodset toSWARLoadMethod.SWAR_IDS.SWAR group entries usually have
GroupEntry.loadSWARset toTrue, andGroupEntry.SWARLoadMethodset toSWARLoadMethod.SWAR_IDS.SSAR group entries usually have
GroupEntry.loadSSARset 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: SWARLoadMethodDefault: SWARLoadMethod.SWAR_IDS
-
type¶ The type of file the group entry refers to.
Type: GroupEntryTypeDefault: GroupEntryType.SSEQ
-
classmethod
fromFlags(type, id[, loadSSEQ[, loadSBNKSWARsFrom[, loadSWAR[, loadSSAR]]]])[source]¶ Create a sound group entry from individual attribute values.
Parameters: - type – The initial value for the
typeattribute. - id – The initial value for the
idattribute. - loadSSEQ – The initial value for the
loadSSEQattribute. - loadSBNKSWARsFrom – The initial value for the
loadSBNKSWARsFromattribute. - loadSWAR – The initial value for the
loadSWARattribute. - loadSSAR – The initial value for the
loadSSARattribute.
Returns: The sound group entry object.
Return type: - type – The initial value for the
-
save()[source]¶ Return this sound group entry’s
type, options value, andidas a triple. This matches the parameters of the default class constructor.Returns: The group entry’s type, options value, andid.Return type: (type, options, id), wheretypeis of typeGroupEntryType,optionsis of typeint, andidis of typeint
-