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
Attenuation
Gets/sets the attenuation
public float Attenuation { get; set; }
Property Value
Gain
Gets/sets the gain
public float Gain { get; set; }
Property Value
GlobalConditions
Gets the global conditions, each a set of properties
public Collection<Collection<AudioConfigurationProperty>> GlobalConditions { get; }
Property Value
InteractiveMusic
Gets the entries of the interactive music
public Collection<AudioConfigurationInteractiveMusicEntry> InteractiveMusic { get; }
Property Value
MoodAttenuations
Gets the attenuations by mood
public Collection<KeyValuePair<ulong, float>> MoodAttenuations { get; }
Property Value
MoodFrequencyOffsets
Gets the frequency offsets by mood
public Collection<KeyValuePair<ulong, float>> MoodFrequencyOffsets { get; }
Property Value
MoodFrequencyPeriods
Gets the frequency periods by mood
public Collection<KeyValuePair<ulong, float>> MoodFrequencyPeriods { get; }
Property Value
MoodPitchChanges
Gets the pitch changes by mood
public Collection<KeyValuePair<ulong, float>> MoodPitchChanges { get; }
Property Value
MoodPlays
Gets whether the sound plays, by mood
public Collection<KeyValuePair<ulong, bool>> MoodPlays { get; }
Property Value
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
PolyphonyDiffersFromBase1
Gets/sets the first of three bytes S4S calls "polyphony differs from base"
public byte PolyphonyDiffersFromBase1 { get; set; }
Property Value
PolyphonyDiffersFromBase2
Gets/sets the second of three bytes S4S calls "polyphony differs from base"
public byte PolyphonyDiffersFromBase2 { get; set; }
Property Value
PolyphonyDiffersFromBase3
Gets/sets the third of three bytes S4S calls "polyphony differs from base"
public byte PolyphonyDiffersFromBase3 { get; set; }
Property Value
Properties
Gets the properties
public Collection<AudioConfigurationProperty> Properties { get; }
Property Value
ResourceName
Gets the name of this resource if it has one
public override string? ResourceName { get; }
Property Value
SampleWeights
Gets the weights of samples, by sample instance (written in version 2 and later)
public Collection<KeyValuePair<ulong, uint>> SampleWeights { get; }
Property Value
Samples
Gets the instances of the AudioVocals resources the configuration plays
public Collection<ulong> Samples { get; }
Property Value
SupportedTypes
Gets a list of resource types that this model supports
public static ISet<ResourceType> SupportedTypes { get; }
Property Value
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
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
Version
Gets/sets the version of the resource, which determines which values Encode() writes
public ushort Version { get; set; }
Property Value
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
VuMeterFacialOverlayModifierScales
Gets the scales of facial overlay modifiers driven by the VU meter
public Collection<KeyValuePair<uint, float>> VuMeterFacialOverlayModifierScales { get; }
Property Value
Methods
Decode(ReadOnlyMemory<byte>)
Decodes the resource in raw format to produce an operable model (🔄️🏃)
public static AudioConfigurationModel Decode(ReadOnlyMemory<byte> data)
Parameters
dataReadOnlyMemory<byte>
Returns
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
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
streamStream
Returns
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
streamStreamcancellationTokenCancellationToken