Moderator: GZDoom Developers
Major Cooke wrote:But can you take a sound and start it off from a position? Should be doable considering you can have LOOP_START data and what not.
Nash wrote:Major Cooke wrote:But can you take a sound and start it off from a position? Should be doable considering you can have LOOP_START data and what not.
I have an open suggestion here and I considered tackling it back there but man, that sound code is just way beyond my simple brain...
void OpenALSoundRenderer::ChannelPitch(FISoundChannel *chan, float pitch)
{
if (chan == NULL || chan->SysChannel == NULL)
return;
alDeferUpdatesSOFT();
ALuint source = GET_PTRID(chan->SysChannel);
alSourcef(source, AL_PITCH, clamp<float>(pitch, -7.f, 7.f)); //SNDINFO's limit is this.
}
Major Cooke wrote:If the script part is giving you trouble, I could take a crack at it. Just to make sure, is this code correct?
- Code: Select all • Expand view
void OpenALSoundRenderer::ChannelPitch(FISoundChannel *chan, float pitch)
{
if (chan == NULL || chan->SysChannel == NULL)
return;
alDeferUpdatesSOFT();
ALuint source = GET_PTRID(chan->SysChannel);
alSourcef(source, AL_PITCH, clamp<float>(pitch, -7.f, 7.f)); //SNDINFO's limit is this.
}
if(WasInWater && !(chan->chanflags&CHAN_UI))
alSourcef(source, AL_PITCH, max<float>(pitch, 0.0001f)*PITCH_MULT);
else
alSourcef(source, AL_PITCH, max<float>(pitch, 0.0001f));
Return to Closed Feature Suggestions
Users browsing this forum: No registered users and 1 guest