diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-31 09:16:11 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-31 09:16:11 +0300 |
commit | 6e1301e9698563fb3a43835199f8c3b8786efb88 (patch) | |
tree | 2313346cbfd7110f02722b02215a884dd86d94f9 | |
parent | 5f9c722c1f6b02191152c83ec0207231d500b6b0 (diff) |
Oops, forgot to do the continuation
Now assert if no continuation performed.
-rw-r--r-- | dnn/fwgan.c | 3 | ||||
-rw-r--r-- | dnn/fwgan.h | 1 | ||||
-rw-r--r-- | dnn/lpcnet_demo.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/dnn/fwgan.c b/dnn/fwgan.c index 14e305f4..63468f06 100644 --- a/dnn/fwgan.c +++ b/dnn/fwgan.c @@ -109,6 +109,8 @@ void fwgan_cont(FWGANState *st, const float *pcm0, const float *features0) compute_generic_dense(&model->fwc7_cont_fc_0, st->fwc7_state, cont_inputs, ACTIVATION_TANH); /* FIXME: Do we need to handle initial features? How? */ + + st->cont_initialized = 1; } static void apply_gain(float *pcm, float c0) { @@ -200,6 +202,7 @@ void fwgan_synthesize(FWGANState *st, float *pcm, const float *features) int period; float lpc_weight; int i; + celt_assert(st->cont_initialized); period = (int)floor(.1 + 50*features[NB_BANDS]+100); w0 = 2*M_PI/period; lpc_from_cepstrum(lpc, features); diff --git a/dnn/fwgan.h b/dnn/fwgan.h index 97c36ba8..32d7844e 100644 --- a/dnn/fwgan.h +++ b/dnn/fwgan.h @@ -43,6 +43,7 @@ typedef struct { FWGAN model; int arch; + int cont_initialized; float embed_phase; float syn_mem[LPC_ORDER]; float deemph_mem; diff --git a/dnn/lpcnet_demo.c b/dnn/lpcnet_demo.c index b486e09e..6930e2f9 100644 --- a/dnn/lpcnet_demo.c +++ b/dnn/lpcnet_demo.c @@ -189,7 +189,9 @@ int main(int argc, char **argv) { lpcnet_destroy(net); } else if (mode == MODE_FWGAN_SYNTHESIS) { FWGANState fwgan; + float zeros[320]; fwgan_init(&fwgan); + fwgan_cont(&fwgan, zeros, NULL); #ifdef USE_WEIGHTS_FILE fwgan_load_model(fwgan, data, len); #endif |