mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-08 07:32:32 +00:00
espeakedit: move the definition of SpectFrame::GetRms out of the class
This commit is contained in:
+1
-1
@@ -1623,7 +1623,7 @@ int LoadSpect(const char *path, int control)
|
||||
|
||||
fr_out->frflags = fr->markers | klatt_flag;
|
||||
|
||||
rms = int(fr->GetRms(spectseq->amplitude));
|
||||
rms = int(GetFrameRms(fr, spectseq->amplitude));
|
||||
if(rms > 255) rms = 255;
|
||||
fr_out->rms = rms;
|
||||
|
||||
|
||||
+7
-7
@@ -222,7 +222,7 @@ int LoadFrame(SpectFrame &frame, wxInputStream& stream, int file_format_type)
|
||||
|
||||
|
||||
|
||||
double SpectFrame::GetRms(int seq_amplitude)
|
||||
double GetFrameRms(SpectFrame *frame, int seq_amplitude)
|
||||
{//=========================================
|
||||
int h;
|
||||
float total=0;
|
||||
@@ -233,12 +233,12 @@ double SpectFrame::GetRms(int seq_amplitude)
|
||||
|
||||
for(h=0; h<9; h++)
|
||||
{
|
||||
height = (peaks[h].pkheight * seq_amplitude * amp_adjust)/10000;
|
||||
height = (frame->peaks[h].pkheight * seq_amplitude * frame->amp_adjust)/10000;
|
||||
wpeaks[h].height = height << 8;
|
||||
|
||||
wpeaks[h].freq = peaks[h].pkfreq << 16;
|
||||
wpeaks[h].left = peaks[h].pkwidth << 16;
|
||||
wpeaks[h].right = peaks[h].pkright << 16;
|
||||
wpeaks[h].freq = frame->peaks[h].pkfreq << 16;
|
||||
wpeaks[h].left = frame->peaks[h].pkwidth << 16;
|
||||
wpeaks[h].right = frame->peaks[h].pkright << 16;
|
||||
}
|
||||
|
||||
maxh = PeaksToHarmspect(wpeaks,90<<16,htab,0);
|
||||
@@ -246,8 +246,8 @@ double SpectFrame::GetRms(int seq_amplitude)
|
||||
{
|
||||
total += ((htab[h] * htab[h]) >> 10);
|
||||
}
|
||||
rms = sqrt(total) / 7.25;
|
||||
return(rms);
|
||||
frame->rms = sqrt(total) / 7.25;
|
||||
return(frame->rms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -91,8 +91,6 @@ public:
|
||||
SpectFrame(SpectFrame *copy=NULL);
|
||||
~SpectFrame();
|
||||
|
||||
double GetRms(int amp);
|
||||
|
||||
int keyframe;
|
||||
int amp_adjust;
|
||||
float length_adjust;
|
||||
@@ -113,6 +111,8 @@ public:
|
||||
peak_t peaks[N_PEAKS];
|
||||
};
|
||||
|
||||
double GetFrameRms(SpectFrame *frame, int amp);
|
||||
|
||||
class SpectSeq
|
||||
{//===========
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user