daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Diverse::Vec<2, float> AudioPlayer::GetFrame(double iPos)
  2.     {
  3.         const size_t IdxLast = (((int)(iPos - 1)) % Present::AudioSamplerBufferSize);
  4.         const size_t IdxNext = (((int)(iPos + 0)) % Present::AudioSamplerBufferSize);
  5.  
  6.         const double FactorLast = 1.0 - fmod((iPos + 1.0), 1.0);
  7.         const double FactorNext = 1.0 - FactorLast;
  8.  
  9.         const float SampleL = (LocalData[IdxLast].X * (float)FactorLast) + (LocalData[IdxNext].X * (float)FactorNext);
  10.         const float SampleR = (LocalData[IdxLast].Y * (float)FactorLast) + (LocalData[IdxNext].Y * (float)FactorNext);
  11.  
  12.         //FilteredSample.X = (FilteredSample.X * LowPass) + (SampleL * (1.f - LowPass));
  13.         //FilteredSample.Y = (FilteredSample.Y * LowPass) + (SampleR * (1.f - LowPass));
  14.  
  15.         //return FilteredSample;
  16.  
  17.         return Diverse::Vec<2,float>(SampleL, SampleR);
  18.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top