Browse Source

Use M_PI instead of PI.

master
Reece H. Dunn 9 years ago
parent
commit
4b61d38551
3 changed files with 6 additions and 11 deletions
  1. 4
    4
      src/libespeak-ng/klatt.c
  2. 0
    3
      src/libespeak-ng/klatt.h
  3. 2
    4
      src/libespeak-ng/wavegen.c

+ 4
- 4
src/libespeak-ng/klatt.c View File

@@ -182,9 +182,9 @@ static void flutter(klatt_frame_ptr frame)

fla = (double)kt_globals.f0_flutter / 50;
flb = (double)kt_globals.original_f0 / 100;
flc = sin(PI*12.7*time_count); // because we are calling flutter() more frequently, every 2.9mS
fld = sin(PI*7.1*time_count);
fle = sin(PI*4.7*time_count);
flc = sin(M_PI*12.7*time_count); // because we are calling flutter() more frequently, every 2.9mS
fld = sin(M_PI*7.1*time_count);
fle = sin(M_PI*4.7*time_count);
delta_f0 = fla * flb * (flc + fld + fle) * 10;
frame->F0hz10 = frame->F0hz10 + (long)delta_f0;
time_count++;
@@ -436,7 +436,7 @@ void KlattReset(int control)
// Full reset
kt_globals.FLPhz = (950 * kt_globals.samrate) / 10000;
kt_globals.BLPhz = (630 * kt_globals.samrate) / 10000;
kt_globals.minus_pi_t = -PI / kt_globals.samrate;
kt_globals.minus_pi_t = -M_PI / kt_globals.samrate;
kt_globals.two_pi_t = -2.0 * kt_globals.minus_pi_t;
setabc(kt_globals.FLPhz, kt_globals.BLPhz, &(kt_globals.rsn[RLP]));
}

+ 0
- 3
src/libespeak-ng/klatt.h View File

@@ -34,9 +34,6 @@ extern "C"
#define SAMPLED 3
#define SAMPLED2 4

#define PI 3.1415927


/* typedef's that need to be exported */

typedef long flag;

+ 2
- 4
src/libespeak-ng/wavegen.c View File

@@ -53,8 +53,6 @@

#include "sintab.h"

#define PI 3.1415927
#define PI2 6.283185307
#define N_WAV_BUF 10

voice_t *wvoice;
@@ -661,7 +659,7 @@ void WavegenInit(int rate, int wavemult_fact)
// wavemult table has preset values for 22050 Hz, we only need to
// recalculate them if we have a different sample rate
for (ix = 0; ix < wavemult_max; ix++) {
x = 127*(1.0 - cos(PI2*ix/wavemult_max));
x = 127*(1.0 - cos((M_PI*2)*ix/wavemult_max));
wavemult[ix] = (int)x;
}
}
@@ -923,7 +921,7 @@ void InitBreath(void)
{
int ix;

minus_pi_t = -PI / samplerate;
minus_pi_t = -M_PI / samplerate;
two_pi_t = -2.0 * minus_pi_t;

for (ix = 0; ix < N_PEAKS; ix++)

Loading…
Cancel
Save