diff --git a/src/libespeak-ng/klatt.c b/src/libespeak-ng/klatt.c index 2d7d32dc..c0c42d75 100644 --- a/src/libespeak-ng/klatt.c +++ b/src/libespeak-ng/klatt.c @@ -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])); } diff --git a/src/libespeak-ng/klatt.h b/src/libespeak-ng/klatt.h index e8425db1..0dbb996e 100644 --- a/src/libespeak-ng/klatt.h +++ b/src/libespeak-ng/klatt.h @@ -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; diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index c3b9d469..c47a7325 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -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++)