GetSoundDefPlayVolume
function · sound · primitive
- Address
0x458c60· 315 bytes, up to0x458d9a- Meaning
- Returns a definition's play volume with its random variation, scaled and clamped to [0, 1]
- Confidence
- verified, proof one
- Finding
- sound/entries#volume-and-pitch-of-a-play
- Test
sound::variation_pitch,sound::variation_volume
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 1
- ApplySoundDefVolumePitch sound
Callees 1
- MulHigh32 cmath
Calls and jumps by a bare address, from tables/calls.tsv.