void Audio::Play( const Sound &sound, const glm::vec3 &pos, const glm::vec3 &vel, const glm::vec3 &dir ) noexcept { int i = NextFree(); if (i < 0) { std::cerr << "unable to find free audio source" << std::endl; return; } ALuint src = source[i]; CoarseTimer &t = timer[i]; sound.Bind(src); alSourcefv(src, AL_POSITION, glm::value_ptr(pos)); alSourcefv(src, AL_VELOCITY, glm::value_ptr(vel)); alSourcefv(src, AL_DIRECTION, glm::value_ptr(dir)); alSourcePlay(src); t = CoarseTimer(sound.Duration()); t.Start(); }