void SoundChannel::Update(const Vector3df& listener_pos) { CalculateAttenuation(listener_pos); SetAttenuatedGain(); QueueBuffers(); UnqueueBuffers(); if (state_ == Foundation::SoundServiceInterface::Playing) { if (handle_) { ALint playing; alGetSourcei(handle_, AL_SOURCE_STATE, &playing); if (playing != AL_PLAYING) { // Stopped state may trigger removal of audio channel, so don't // do that in buffered mode if (buffered_mode_) { state_ = Foundation::SoundServiceInterface::Pending; } else state_ = Foundation::SoundServiceInterface::Stopped; } } } }
void SoundSource3D::Update(float timeStep) { CalculateAttenuation(); SoundSource::Update(timeStep); }