51void Audio_StartSoundPlayback(int32_t slot_index, uint32_t
const *riff_data, int32_t pitch_q12, int32_t volume, int32_t pan,
char loop_flag)
70 g_soundSlots[slot_index].base_playback_rate = base_playback_rate;
72 if (!base_playback_rate)
106 if (clear_resource_flag)
153 if (!allocated_entry)
158 for (; active_entry; active_entry = active_entry->
next)
166 replacement_entry = active_entry;
171 if (!replacement_entry)
176 replacement_entry = active_entry;
181 allocated_entry = replacement_entry;
183 if (!replacement_entry)
197 allocated_entry->
next = NULL;
205 previous_tail->
next = allocated_entry;
217 int32_t matched_slot_index = slot_index;
219 if (!(matched_slot_index >= 0 && matched_definition))
230 if (active_entry->
position_ptr == position && (!matched_definition || active_entry->
sound_def_ptr == matched_definition))
239 if (sample_still_playing)
259 if (sound_def_ptr != matched_definition)
262 int32_t sample_playing;
268 return matched_slot_index;
366 volume_fp12 += random_volume_offset - (range >> 1);
379 if (pitch_random_range)
397 uint32_t pitch_q12 = (uint16_t)active_entry->
pitch;
398 uint32_t adjusted_pitch_q12 = pitch_q12;
409 int32_t
x = position_ptr->
x;
411 int32_t emitter_z = position_ptr->
z;
412 int32_t relative_motion_z = active_entry->
listener_pos.
z - listener_position->
z - active_entry->
sound_pos.
z + emitter_z;
414 if (relative_motion_x || relative_motion_z)
416 int32_t listener_offset_x = listener_position->
x -
x;
417 int32_t listener_offset_z = listener_position->
z - emitter_z;
419 if (listener_offset_x || listener_offset_z)
426 motion_bearing_difference =
AUDIO_Q12_ONE - motion_bearing_difference;
428 uint32_t pitch_scale_q12 =
431 adjusted_pitch_q12 = pitch_scale_q12;
439 active_entry->
sound_pos.
x = updated_emitter_position->
x;
440 active_entry->
sound_pos.
y = updated_emitter_position->
y;
441 active_entry->
sound_pos.
z = updated_emitter_position->
z;
448 pitch_q12 = adjusted_pitch_q12;
456 int16_t pan_angle = active_entry->
pan;
458 volume_q12 = (uint16_t)active_entry->
volume;
465 int32_t distance_gain_q12 = (int32_t)volume_q12;
478 pan_angle = active_entry->
pan;
494 if (game_complete == 1)
501 if (game_complete != 1 || !riff_data)
517 }
while (active_entry);
527 int32_t slot_index = 0;
537 *paused_pitch_ptr = (uint16_t)sample_playing;
539 paused_pitch_ptr = &paused_pitch_ptr[1];
548 int32_t slot_index = 0;
552 uint16_t saved_pitch_q12 = *paused_pitch_ptr;
559 paused_pitch_ptr = &paused_pitch_ptr[1];
#define AUDIO_INVALID_SOUND_INDEX
#define AUDIO_PAN_WRAP_MASK
#define AUDIO_FREE_CHANNEL_LAST_INDEX
#define AUDIO_RIFF_SIGNATURE
#define AUDIO_SOUND_RESERVED_CHANNEL
#define AUDIO_CHANNEL_STARTED
#define AUDIO_SOUND_DISTANCE_VOLUME
#define AUDIO_SOUND_RANDOM_VOLUME
#define AUDIO_DOPPLER_BASE_SCALE_Q12
#define AUDIO_RANDOM_PITCH_RANGE_SHIFT
#define AUDIO_PACKED_PAN_SHIFT
#define AUDIO_PAN_HALF_TURN
#define AUDIO_SOUND_DOPPLER_PITCH
#define AUDIO_INVALID_CACHE_VALUE
#define AUDIO_RESERVED_CHANNEL_INDEX
#define AUDIO_SOUND_SPATIAL_PAN
#define AUDIO_CHANNEL_COUNT
#define AUDIO_SOUND_PROTECT_FROM_REPLACEMENT
#define AUDIO_SOUND_RANDOM_PITCH
void Audio_SetSamplePan(int32_t slot_index, int32_t pan_fp12)
uint8_t Audio_CalculateSpatialVolumeAndPan(struct Math_Vec3I32 *sound_position, uint32_t audible_radius, int32_t *out_volume_q12, int16_t *out_pan_angle)
void Audio_ProcessMusicFade(void)
void Audio_SetSampleVolume(int32_t slot_index, int32_t volume_fp12)
void Audio_StopMusicAndPauseThunk(void)
uint8_t Audio_FreeSoundSlot(int32_t slot_index, BOOL clear_resource_flag)
int32_t Audio_IsSamplePlaying(int32_t slot_index)
void Audio_SetSamplePitch(int32_t slot_index, int32_t pitch_scale_q12)
void Audio_StopAllSamples(void)
#define g_soundSlotListPtr
#define Audio_InitializeSystem_DigitalDriver
#define g_activeSoundList
#define g_soundVolumeArray
void Audio_ResumeAllSounds()
uint8_t Audio_FreeSoundSlot(int32_t slot_index, BOOL clear_resource_flag)
void Audio_StopAllSounds()
void Audio_ProcessSoundQueue()
void Audio_StopSound(int32_t slot_index)
void Audio_UpdateSoundChannels(int32_t channel_mask)
void Audio_StartSoundPlayback(int32_t slot_index, uint32_t const *riff_data, int32_t pitch_q12, int32_t volume, int32_t pan, char loop_flag)
void Audio_ReleaseSoundHandle(int32_t slot_index)
void Audio_PauseAllSounds()
int32_t Audio_FindSoundByType(int32_t slot_index, struct Audio_SoundDefinition *sound_def, struct Math_Vec3I32 *position)
int32_t Audio_AllocateSoundSlot(struct Audio_SoundDefinition *sound_def)
#define GAME_OVERLAY_SKIP_NODE_ANIMATION
#define GAME_TRANSITION_SCRIPT_PAUSED
#define GAME_OVERLAY_SKIP_OBJECT_RENDER
#define Game_FrameTransitionFlags
#define Game_FrameOverlayFlags
int32_t AIL_set_digital_master_volume(AIL_HDIGDRIVER driver, int32_t volume)
int32_t AIL_set_sample_file(AIL_HSAMPLE sample, void const *file_image, int32_t block)
int32_t AIL_start_sample(AIL_HSAMPLE sample)
int32_t AIL_set_sample_loop_count(AIL_HSAMPLE sample, int32_t loop_count)
int32_t AIL_end_sample(AIL_HSAMPLE sample)
int32_t AIL_init_sample(AIL_HSAMPLE sample)
int32_t AIL_sample_playback_rate(AIL_HSAMPLE sample)
int32_t AIL_stop_sample(AIL_HSAMPLE sample)
uint32_t Math_SetRandomSeed(uint32_t seed)
int16_t Math_CalculateAtan2FP12(int32_t y, int32_t x)
uint32_t Math_GenerateRandom(uint32_t range)
int32_t Save_IsGameComplete(void)
uint16_t Settings_GetSfxVolume(void)
uint8_t replacement_priority
int32_t spatial_range_fp12
struct Audio_SoundEntry * prev
struct Audio_SoundEntry * next
struct Audio_SoundDefinition * sound_def_ptr
struct Audio_SoundEntry::@100114371203023164022211357127366373354240353340 sound_pos
struct Audio_SoundEntry::@003200205222232126264271107277074317264256323153 listener_pos
struct Math_Vec3I32 * position_ptr