From cb32f6030c30cfd6b32f3f622da1cf148b68af8d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 12 Aug 2005 02:41:08 +0000 Subject: [PATCH] Added pitch to fix slomo. --- Source/openal_wrapper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index c717e00..bc80c0b 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -437,6 +437,18 @@ signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min signed char F_API OPENAL_SetFrequency(int channel, int freq) { if (!initialized) return FALSE; + if (channel == FSOUND_ALL) + { + for (int i = 0; i < num_channels; i++) + OPENAL_SetFrequency(i, freq); + return TRUE; + } + + if ((channel < 0) || (channel >= num_channels)) return FALSE; + if (freq == 8012) // hack + alSourcef(channels[channel].sid, AL_PITCH, 8012.0f / 44100.0f); + else + alSourcef(channels[channel].sid, AL_PITCH, 1.0f); return TRUE; // ignore this for now... } -- 2.39.5