From 60b5bb138640e97a3ff6315c3ec702dec51019c1 Mon Sep 17 00:00:00 2001 From: John Glover Date: Fri, 10 Dec 2010 16:38:12 +0000 Subject: Bug fix: synthesis via sineSynthFrame was failing because magnitudes were not in DB. --- sms/synthesis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sms') diff --git a/sms/synthesis.c b/sms/synthesis.c index c7439f1..3a7682a 100644 --- a/sms/synthesis.c +++ b/sms/synthesis.c @@ -50,7 +50,7 @@ static void SineSynthIFFT(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams) if(pSynthParams->prevFrame.pFSinAmp[i] <= 0) pSynthParams->prevFrame.pFSinPha[i] = TWO_PI * sms_random(); - // fMag = sms_dBToMag(fMag); + fMag = sms_dBToMag(fMag); fTmp = pSynthParams->prevFrame.pFSinPha[i] + TWO_PI * fFreq * fSamplingPeriod * sizeMag; fPhase = fTmp - floor(fTmp * INV_TWO_PI) * TWO_PI; @@ -126,8 +126,6 @@ static int StocSynthApprox(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams) if (*(pSmsData->pFStocGain) <= 0) return 0; - // *(pSmsData->pFStocGain) = sms_dBToMag(*(pSmsData->pFStocGain)); - sizeSpec1Used = sizeSpec1 * pSynthParams->iSamplingRate / pSynthParams->iOriginalSRate; @@ -165,7 +163,7 @@ void sms_synthesize(SMS_Data *pSmsData, sfloat *pFSynthesis, SMS_SynthParams *p memset(pSynthParams->pSynthBuff+sizeHop, 0, sizeof(sfloat) * sizeHop); /* convert mags from linear to db */ - /*sms_arrayMagToDB(pSmsData->nTracks, pSmsData->pFSinAmp);*/ + sms_arrayMagToDB(pSmsData->nTracks, pSmsData->pFSinAmp); /* decide which combo of synthesis methods to use */ if(pSynthParams->iSynthesisType == SMS_STYPE_ALL) -- cgit v1.2.3