forked from mirror/openmw-tes3mp
Load sound loudness and store it with the Sound_Buffer
Still not used for say yet, thoughopenmw-38
parent
f4c22ec49e
commit
495e138907
@ -1,23 +0,0 @@
|
||||
#include "sound.hpp"
|
||||
|
||||
namespace MWSound
|
||||
{
|
||||
|
||||
float Sound::getCurrentLoudness()
|
||||
{
|
||||
if (mLoudnessVector.empty())
|
||||
return 0.f;
|
||||
int index = static_cast<int>(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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue