[Openal-devel] Bug in ALUT_WAVEFORM_SINE?

Dave Dribin dave-ml at dribin.org
Fri Feb 13 13:55:06 PST 2009


Hi,

I was looking through the code that generates a sine wave, and I think  
it's incorrect.  The [0..+1) phase should be multiplied by 2*pi not  
pi, right?

-Dave

----

Index: alut/src/alutWaveform.c
===================================================================
--- alut/src/alutWaveform.c	(revision 1622)
+++ alut/src/alutWaveform.c	(working copy)
@@ -20,7 +20,7 @@
  waveformSine (double UNUSED (lastPhase), double phase)
  {
    static const double pi = 3.14159265358979323846;
-  return sin (phase * pi);
+  return sin (phase * 2 * pi);
  }

  static double



More information about the Openal-devel mailing list