From 38f4ea7aa3773e5fa9ff99fa131b7db223117009 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 24 Aug 2021 13:11:36 +0300 Subject: Audio enhancements: * redo high fps fix * make releasing vehicle sounds attach to entities * fix bug with reusing audio entity that is still being used * use time scale to modify sound speed --- src/audio/AudioLogic.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/audio/AudioLogic.cpp') diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 0ba2190d..da46d0d7 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -1389,7 +1389,11 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile * freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; if (engineSoundType == SFX_BANK_TRUCK) freq /= 2; +#ifdef USE_TIME_SCALE_FOR_AUDIO + SampleManager.SetChannelFrequency(CHANNEL_PLAYER_VEHICLE_ENGINE, freq * CTimer::GetTimeScale()); +#else SampleManager.SetChannelFrequency(CHANNEL_PLAYER_VEHICLE_ENGINE, freq); +#endif if (!channelUsed) { #if GTA_VERSION >= GTA3_PC_10 SampleManager.SetChannelReverbFlag(CHANNEL_PLAYER_VEHICLE_ENGINE, m_bDynamicAcousticModelingStatus != FALSE); @@ -6102,7 +6106,7 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; #endif // FIX_BUGS #endif // EXTERNAL_3D_SOUND -#ifdef ATTACH_PED_COMMENTS_TO_ENTITIES +#ifdef ATTACH_RELEASING_SOUNDS_TO_ENTITIES // let's disable doppler because if sounds funny as the sound moves // originally position of ped comment doesn't change so this has no effect anyway AudioManager.m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6174,8 +6178,10 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_bIs2D = FALSE; AudioManager.m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(AudioManager.m_sQueueSample.m_nSampleIndex) + AudioManager.RandomDisplacement(750); +#ifndef USE_TIME_SCALE_FOR_AUDIO if (CTimer::GetIsSlowMotionActive()) - AudioManager.m_sQueueSample.m_nFrequency /= 2; + AudioManager.m_sQueueSample.m_nFrequency >>= 1; +#endif m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_nProcess = -1; AudioManager.AddSampleToRequestedQueue(); default: -- cgit v1.2.3