ApplySoundDefVolumePitch
function · sound · primitive
- Address
0x458da0· 297 bytes, up to0x458ec8- Meaning
- Sets a sound's play volume and, with flag 0x400, a random frequency
- Confidence
- verified, proof one
- Finding
- sound/entries#volume-and-pitch-of-a-play
- Test
sound::variation_pitch
Finding: Volume and pitch of a play in sound: sound entries and plays
0x458c60(def, m) returns the play volume: the definition's volume, plus n · 0.01 with
n = MulHigh32(31, r) − 15 when flag 0x800 is set, times m, clamped to [0, 1] with NaN to 0.
0x458da0(def, sound, m) sets that volume and, when flag 0x400 is set, the frequency
trunc(22050 · (85 + MulHigh32(31, r)) / 100) Hz, absolute rather than relative to the file's rate.
Both draws advance the client's shared generator.
The derivation is in the doc.
Callers 8
- PlaySoundLoop2D sound
- PlaySoundLoop3D sound
- PlayObjectSoundLoop sound
- InternalPlaySound sound
- InternalPlaySoundAt sound
- PlayZoneIntro sound
- ServeEmitterEntry sound
- StartWaterLoop sound
Callees 4
- MulHigh32 cmath
- GetSoundDefPlayVolume sound
- Sound::SetVolume2 sound
- Sound::SetFrequency sound
Calls and jumps by a bare address, from tables/calls.tsv.