coastline 0.0.4
Loading...
Searching...
No Matches
volume.h File Reference
#include <stdint.h>
Include dependency graph for volume.h:

Go to the source code of this file.

Functions

int32_t __stdcall ConvertPercentGainToDirectSoundVolume (double gain)
 Approximate percentage gain as DirectSound attenuation using the native quartic polynomial.
int32_t __stdcall ConvertPercentGainToLeftPan (double gain)
 Convert a percentage gain to the DirectSound pan of the left side.
int32_t __stdcall ConvertPercentGainToRightPan (double gain)
 Convert a percentage gain to the DirectSound pan of the right side.

Function Documentation

◆ ConvertPercentGainToDirectSoundVolume()

int32_t __stdcall ConvertPercentGainToDirectSoundVolume ( double gain)

Approximate percentage gain as DirectSound attenuation using the native quartic polynomial.

Parameters
gainThe percentage amplitude, normally 0..100; input and output are not clamped.
Returns
Attenuation in hundredths of a decibel, truncated to an integer's low 32 bits; zero when the polynomial cannot be converted to a signed 64-bit integer.
Ghidra address:
EAR: 0x10012420

◆ ConvertPercentGainToLeftPan()

int32_t __stdcall ConvertPercentGainToLeftPan ( double gain)

Convert a percentage gain to the DirectSound pan of the left side.

Parameters
gainThe gain, as a percentage.
Returns
The volume of the gain, in hundredths of a decibel.
Ghidra address:
EAR: 0x10012400

◆ ConvertPercentGainToRightPan()

int32_t __stdcall ConvertPercentGainToRightPan ( double gain)

Convert a percentage gain to the DirectSound pan of the right side.

Parameters
gainThe gain, as a percentage.
Returns
The negated volume of the gain, in hundredths of a decibel.
Ghidra address:
EAR: 0x10012480