Browse Source

code cleanup: combine Wavegen() and Wavegen2().

    Wavegen2() only had one if-statement and then called
    Wavegen(). Wavegen() was never called directly.
master
Juho Hiltunen 5 years ago
parent
commit
3b4cca4832
1 changed files with 7 additions and 10 deletions
  1. 7
    10
      src/libespeak-ng/wavegen.c

+ 7
- 10
src/libespeak-ng/wavegen.c View File

@@ -51,6 +51,8 @@

#define N_WAV_BUF 10

static void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v);

voice_t *wvoice = NULL;

FILE *f_log = NULL;
@@ -679,8 +681,11 @@ static int ApplyBreath(void)
return value;
}

static int Wavegen()
static int Wavegen(int length, int modulation, bool resume, frame_t *fr1, frame_t *fr2)
{
if (resume == false)
SetSynth(length, modulation, fr1, fr2, wvoice);

if (wvoice == NULL)
return 0;

@@ -1244,14 +1249,6 @@ static void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *
}
}

static int Wavegen2(int length, int modulation, bool resume, frame_t *fr1, frame_t *fr2)
{
if (resume == false)
SetSynth(length, modulation, fr1, fr2, wvoice);

return Wavegen();
}

void Write4Bytes(FILE *f, int value)
{
// Write 4 bytes to a file, least significant first
@@ -1338,7 +1335,7 @@ static int WavegenFill2()
wdata.n_mix_wavefile = 0; // ... and drop through to WCMD_SPECT case
case WCMD_SPECT:
echo_complete = echo_length;
result = Wavegen2(length & 0xffff, q[1] >> 16, resume, (frame_t *)q[2], (frame_t *)q[3]);
result = Wavegen(length & 0xffff, q[1] >> 16, resume, (frame_t *)q[2], (frame_t *)q[3]);
break;
#ifdef INCLUDE_KLATT
case WCMD_KLATT2: // as WCMD_SPECT but stop any concurrent wave file

Loading…
Cancel
Save