diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2009-08-17 14:20:48 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2009-08-17 14:20:48 -0700 |
commit | 7bc39b0d41efe0d8733490d54e14bc392d9f0b6d (patch) | |
tree | db46c91063b1d9ca27c4618c9262a1fd09014c94 /pico/lib/picosig.c | |
parent | a2301be089f8ed570c5bb755ff7c82b130959851 (diff) | |
download | external_svox-7bc39b0d41efe0d8733490d54e14bc392d9f0b6d.zip external_svox-7bc39b0d41efe0d8733490d54e14bc392d9f0b6d.tar.gz external_svox-7bc39b0d41efe0d8733490d54e14bc392d9f0b6d.tar.bz2 |
Integrate SVOX update that offers two modes to reset the engine: soft
and full. Soft reset is lighter-weight than the previous pico_resetEngine()
function as it only clears the input (text) and output (audio data)
buffers of the synthesis engine.
The synthesis loop is now taking advantage of the soft reset whenever
it is interrupted, rather than performing a full engine reset after
each call to stop().
Diffstat (limited to 'pico/lib/picosig.c')
-rw-r--r-- | pico/lib/picosig.c | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/pico/lib/picosig.c b/pico/lib/picosig.c index be44b3c..4282e24 100644 --- a/pico/lib/picosig.c +++ b/pico/lib/picosig.c @@ -114,7 +114,7 @@ typedef struct sig_subobj * @callgraph * @callergraph */ -static pico_status_t sigInitialize(register picodata_ProcessingUnit this) +static pico_status_t sigInitialize(register picodata_ProcessingUnit this, picoos_int32 r_mode) { sig_subobj_t *sig_subObj; if (NULL == this || NULL == this->subObj) { @@ -147,33 +147,40 @@ static pico_status_t sigInitialize(register picodata_ProcessingUnit this) /*----------------------------------------------------------------- * MANAGE LINGWARE INITIALIZATION IF NEEDED ------------------------------------------------------------------*/ - sig_subObj->pdfmgc = picokpdf_getPdfMUL( - this->voice->kbArray[PICOKNOW_KBID_PDF_MGC]); - sig_subObj->pdflfz = picokpdf_getPdfMUL( - this->voice->kbArray[PICOKNOW_KBID_PDF_LFZ]); - sig_subObj->pdfphs = picokpdf_getPdfPHS( - this->voice->kbArray[PICOKNOW_KBID_PDF_PHS]); - - sig_subObj->scmeanpowLFZ = sig_subObj->pdflfz->bigpow - - sig_subObj->pdflfz->meanpow; - sig_subObj->scmeanpowMGC = sig_subObj->pdfmgc->bigpow - - sig_subObj->pdfmgc->meanpow; - sig_subObj->scmeanLFZ = (1 << (picoos_uint32) sig_subObj->scmeanpowLFZ); - sig_subObj->scmeanMGC = (1 << (picoos_uint32) sig_subObj->scmeanpowMGC); - sig_subObj->fSampNorm = PICOSIG_NORM1 * sig_subObj->pdfmgc->amplif; - - /*----------------------------------------------------------------- - * Initialize memory for DSP - * ------------------------------------------------------------------*/ - sigDspInitialize(&(sig_subObj->sig_inner)); + if (r_mode == PICO_RESET_FULL) { + /*not done when resetting SOFT*/ + sig_subObj->pdfmgc = picokpdf_getPdfMUL( + this->voice->kbArray[PICOKNOW_KBID_PDF_MGC]); + sig_subObj->pdflfz = picokpdf_getPdfMUL( + this->voice->kbArray[PICOKNOW_KBID_PDF_LFZ]); + sig_subObj->pdfphs = picokpdf_getPdfPHS( + this->voice->kbArray[PICOKNOW_KBID_PDF_PHS]); + + sig_subObj->scmeanpowLFZ = sig_subObj->pdflfz->bigpow + - sig_subObj->pdflfz->meanpow; + sig_subObj->scmeanpowMGC = sig_subObj->pdfmgc->bigpow + - sig_subObj->pdfmgc->meanpow; + sig_subObj->scmeanLFZ = (1 << (picoos_uint32) sig_subObj->scmeanpowLFZ); + sig_subObj->scmeanMGC = (1 << (picoos_uint32) sig_subObj->scmeanpowMGC); + sig_subObj->fSampNorm = PICOSIG_NORM1 * sig_subObj->pdfmgc->amplif; + /*----------------------------------------------------------------- + * Initialize memory for DSP + * ------------------------------------------------------------------*/ + sigDspInitialize(&(sig_subObj->sig_inner), r_mode); + /*----------------------------------------------------------------- + * Initialize modifiers + * ------------------------------------------------------------------*/ + /*pitch , volume , speaker modifiers*/ + sig_subObj->pMod = 1.0f; + sig_subObj->vMod = 1.0f; + sig_subObj->sMod = 1.0f; + } else { + /*----------------------------------------------------------------- + * Initialize memory for DSP + * ------------------------------------------------------------------*/ + sigDspInitialize(&(sig_subObj->sig_inner), r_mode); + } - /*----------------------------------------------------------------- - * Initialize modifiers - * ------------------------------------------------------------------*/ - /*pitch , volume , speaker modifiers*/ - sig_subObj->pMod = 1.0f; - sig_subObj->vMod = 1.0f; - sig_subObj->sMod = 1.0f; return PICO_OK; }/*sigInitialize*/ @@ -287,7 +294,7 @@ picodata_ProcessingUnit picosig_newSigUnit(picoos_MemoryManager mm, /*----------------------------------------------------------------- * Initialize memory for DSP (this may be re-used elsewhere, e.g.Reset) * ------------------------------------------------------------------*/ - if (PICO_OK != sigInitialize(this)) { + if (PICO_OK != sigInitialize(this, PICO_RESET_FULL)) { PICODBG_ERROR(("Error in iSig Sub Object initialization")); sigDeallocate(mm, &(sig_subObj->sig_inner)); picoos_deallocate(mm, (void *) &this); |