Browse Source

wavegen: fix unitialized pitch

master
Yury Popov 1 year ago
parent
commit
a5eb246deb
No account linked to committer's email address
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      src/libespeak-ng/wavegen.c

+ 6
- 3
src/libespeak-ng/wavegen.c View File

@@ -540,14 +540,14 @@ static void AdvanceParameters(void)
if (wvoice == NULL)
return;

int x;
int x = 0;
int ix;
static int Flutter_ix = 0;

// advance the pitch
wdata.pitch_ix += wdata.pitch_inc;
if ((ix = wdata.pitch_ix>>8) > 127) ix = 127;
x = wdata.pitch_env[ix] * wdata.pitch_range;
if (wdata.pitch_env) x = wdata.pitch_env[ix] * wdata.pitch_range;
wdata.pitch = (x>>8) + wdata.pitch_base;
@@ -563,7 +563,7 @@ static void AdvanceParameters(void)
if(const_f0)
wdata.pitch = (const_f0<<12);
if (wdata.pitch < 102400)
wdata.pitch = 102400; // min pitch, 25 Hz (25 << 12)

@@ -1265,6 +1265,9 @@ static int WavegenFill2(void)
static bool resume = false;
static int echo_complete = 0;

if (wdata.pitch < 102400)
wdata.pitch = 102400; // min pitch, 25 Hz (25 << 12)

while (out_ptr < out_end) {
if (WcmdqUsed() <= 0) {
if (echo_complete > 0) {

Loading…
Cancel
Save