Go to the source code of this file.
◆ attenuation_model_to_string()
Gets the string representation of the given attenuation model. NOTE: string is constant and does not need to be freed.
- Parameters
-
model | The model to convert. |
- Returns
- the string representation of the given attenuation model.
◆ audio_space_to_string()
Gets the string representation of the given sound space. NOTE: string is constant and does not need to be freed.
- Parameters
-
space | The audio space to convert. |
- Returns
- the string representation of the given audio space.
◆ calculate_spatial_gain()
Computes spatial gain based on position, radius and attenuation model parameters.
- Parameters
-
distance | The distance between the listener and the center point of the sound in the world. |
inner_radius | The inner radius around the sound's center point. A listener inside this radius experiences the volume at 100%. |
outer_radius | The outer radius around the sound's center point. A listener outside this radius experiences the volume at 0%. |
falloff_factor | The falloff factor used for exponential falloff. Ignored for other models. |
model | The model to use for the sound attenuation. |
- Returns
- The final gain of the sound based on the supplied parameters, before being mixed with volume.
◆ kaudio_downmix_stereo_to_mono()
KAPI i16* kaudio_downmix_stereo_to_mono |
( |
const i16 * |
stereo_data, |
|
|
u32 |
sample_count |
|
) |
| |
Downmixes the provided stereo data to mono data by averaging the left and right channels and scaling it to fit within an i16.
- Parameters
-
stereo_data | The raw interleaved sample data in stereo format. |
sample_count | The total number of samples. |
- Returns
- A dynamically-allocated array of downmixed mono data on success; otherwise 0/null.
◆ string_to_attenuation_model()
Parses the attenuation model from the given string. Defaults to linear if not valid.
- Parameters
-
- Returns
- The attenuation model.
◆ string_to_audio_space()
Parses the audio space from the given string. Defaults to 2D if not valid.
- Parameters
-
- Returns
- The sound space.