Table of Contents

Class AudioConfigurationModel

Namespace
LlamaLogic.Packages.Models.AudioConfiguration
Assembly
LlamaLogic.Packages.dll

Represents a AudioConfiguration resource (a PROPX): the audio a sound plays and how the game plays it (🔓)

public sealed class AudioConfigurationModel : Model, IModel<AudioConfigurationModel>, IModel
Inheritance
AudioConfigurationModel
Implements
Inherited Members

Remarks

Tuning refers to a configuration with a key of type AudioConfigurationReference and the configuration's instance. A configuration's Samples are the instances of AudioVocals resources (with their AudioEffects bodies, if streamed), and nearly all of the game's configurations have a Parent. Versions 1 through 7 are supported; version 3 is that of nearly all of the game's configurations. Adapted from S4S by Andrew, extended to read the list version 3 added, which S4S does not.

Properties

AggregateGain

Gets/sets the aggregate gain

public byte AggregateGain { get; set; }

Property Value

byte

Attenuation

Gets/sets the attenuation

public float Attenuation { get; set; }

Property Value

float

Gain

Gets/sets the gain

public float Gain { get; set; }

Property Value

float

GlobalConditions

Gets the global conditions, each a set of properties

public Collection<Collection<AudioConfigurationProperty>> GlobalConditions { get; }

Property Value

Collection<Collection<AudioConfigurationProperty>>

InteractiveMusic

Gets the entries of the interactive music

public Collection<AudioConfigurationInteractiveMusicEntry> InteractiveMusic { get; }

Property Value

Collection<AudioConfigurationInteractiveMusicEntry>

MoodAttenuations

Gets the attenuations by mood

public Collection<KeyValuePair<ulong, float>> MoodAttenuations { get; }

Property Value

Collection<KeyValuePair<ulong, float>>

MoodFrequencyOffsets

Gets the frequency offsets by mood

public Collection<KeyValuePair<ulong, float>> MoodFrequencyOffsets { get; }

Property Value

Collection<KeyValuePair<ulong, float>>

MoodFrequencyPeriods

Gets the frequency periods by mood

public Collection<KeyValuePair<ulong, float>> MoodFrequencyPeriods { get; }

Property Value

Collection<KeyValuePair<ulong, float>>

MoodPitchChanges

Gets the pitch changes by mood

public Collection<KeyValuePair<ulong, float>> MoodPitchChanges { get; }

Property Value

Collection<KeyValuePair<ulong, float>>

MoodPlays

Gets whether the sound plays, by mood

public Collection<KeyValuePair<ulong, bool>> MoodPlays { get; }

Property Value

Collection<KeyValuePair<ulong, bool>>

Parent

Gets/sets the instance of the configuration this one inherits from, or zero if it has none

public ulong Parent { get; set; }

Property Value

ulong

PolyphonyDiffersFromBase1

Gets/sets the first of three bytes S4S calls "polyphony differs from base"

public byte PolyphonyDiffersFromBase1 { get; set; }

Property Value

byte

PolyphonyDiffersFromBase2

Gets/sets the second of three bytes S4S calls "polyphony differs from base"

public byte PolyphonyDiffersFromBase2 { get; set; }

Property Value

byte

PolyphonyDiffersFromBase3

Gets/sets the third of three bytes S4S calls "polyphony differs from base"

public byte PolyphonyDiffersFromBase3 { get; set; }

Property Value

byte

Properties

Gets the properties

public Collection<AudioConfigurationProperty> Properties { get; }

Property Value

Collection<AudioConfigurationProperty>

ResourceName

Gets the name of this resource if it has one

public override string? ResourceName { get; }

Property Value

string

SampleWeights

Gets the weights of samples, by sample instance (written in version 2 and later)

public Collection<KeyValuePair<ulong, uint>> SampleWeights { get; }

Property Value

Collection<KeyValuePair<ulong, uint>>

Samples

Gets the instances of the AudioVocals resources the configuration plays

public Collection<ulong> Samples { get; }

Property Value

Collection<ulong>

SupportedTypes

Gets a list of resource types that this model supports

public static ISet<ResourceType> SupportedTypes { get; }

Property Value

ISet<ResourceType>

UnidentifiedFlagMaps

Gets the maps from 64-bit keys to flags that version 4 and later add (four in version 4 and one more in each later version), whose meaning is not known

public Collection<Collection<KeyValuePair<ulong, bool>>> UnidentifiedFlagMaps { get; }

Property Value

Collection<Collection<KeyValuePair<ulong, bool>>>

UnidentifiedMap

Gets the map from 64-bit keys to 32-bit values that version 3 added, whose meaning is not known (written in version 3 and later)

public Collection<KeyValuePair<ulong, uint>> UnidentifiedMap { get; }

Property Value

Collection<KeyValuePair<ulong, uint>>

Version

Gets/sets the version of the resource, which determines which values Encode() writes

public ushort Version { get; set; }

Property Value

ushort

Exceptions

ArgumentOutOfRangeException

The value is not 1 through 7

VuMeterFacialOverlayModifierOffsets

Gets the offsets of facial overlay modifiers driven by the VU meter

public Collection<KeyValuePair<uint, float>> VuMeterFacialOverlayModifierOffsets { get; }

Property Value

Collection<KeyValuePair<uint, float>>

VuMeterFacialOverlayModifierScales

Gets the scales of facial overlay modifiers driven by the VU meter

public Collection<KeyValuePair<uint, float>> VuMeterFacialOverlayModifierScales { get; }

Property Value

Collection<KeyValuePair<uint, float>>

Methods

Decode(ReadOnlyMemory<byte>)

Decodes the resource in raw format to produce an operable model (🔄️🏃)

public static AudioConfigurationModel Decode(ReadOnlyMemory<byte> data)

Parameters

data ReadOnlyMemory<byte>

Returns

AudioConfigurationModel

Exceptions

InvalidDataException

The data is not a well-formed audio configuration of version 1 through 7

Encode()

Encodes the resource model into raw format (🔄️🏃)

public override ReadOnlyMemory<byte> Encode()

Returns

ReadOnlyMemory<byte>

Exceptions

InvalidOperationException

UnidentifiedFlagMaps does not have as many maps as Version has (none before version 4, then as many as the version)

GetName(Stream)

Gets the name of a resource from its raw data, if it has one (🔄️💤)

public static string? GetName(Stream stream)

Parameters

stream Stream

Returns

string

GetNameAsync(Stream, CancellationToken)

Gets the name of a resource from its raw data, if it has one, asynchronously (🔄️💤)

public static Task<string?> GetNameAsync(Stream stream, CancellationToken cancellationToken = default)

Parameters

stream Stream
cancellationToken CancellationToken

Returns

Task<string>