Fixed pan bug in SampleSource::CalcGainFactors()
diff --git a/samples/iolib/src/main/cpp/player/SampleSource.h b/samples/iolib/src/main/cpp/player/SampleSource.h
index 3f18a7a..69dc57b 100644
--- a/samples/iolib/src/main/cpp/player/SampleSource.h
+++ b/samples/iolib/src/main/cpp/player/SampleSource.h
@@ -93,9 +93,9 @@
private:
void calcGainFactors() {
// useful panning information: http://www.cs.cmu.edu/~music/icm-online/readings/panlaws/
- mRightGain = ((mPan * 0.5) + 0.5) * mGain;
- mLeftGain = (1.0 - mRightGain) * mGain;
- }
+ float rightPan = (mPan * 0.5) + 0.5;
+ mRightGain = rightPan * mGain;
+ mLeftGain = (1.0 - rightPan) * mGain; }
};
} // namespace wavlib