mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 22:19:54 +00:00
23 lines
513 B
C++
23 lines
513 B
C++
#include "sound.hpp"
|
|
|
|
namespace MWSound
|
|
{
|
|
|
|
float Sound::getCurrentLoudness()
|
|
{
|
|
if (mLoudnessVector.empty())
|
|
return 0.f;
|
|
int index = getTimeOffset() * mLoudnessFPS;
|
|
|
|
index = std::max(0, std::min(index, int(mLoudnessVector.size()-1)));
|
|
|
|
return mLoudnessVector[index];
|
|
}
|
|
|
|
void Sound::setLoudnessVector(const std::vector<float> &loudnessVector, float loudnessFPS)
|
|
{
|
|
mLoudnessVector = loudnessVector;
|
|
mLoudnessFPS = loudnessFPS;
|
|
}
|
|
|
|
}
|