[1.28.07] Changed the format of envelope files (phsource/envelope). These are not text files which contains coordinates which define the envelope.

The compile_phoneme_data operation now produces an image file phsource/envelopes.png which shows the shape of the envelopes.

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@78 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-08-21 14:44:24 +00:00
parent 02c49ce573
commit cbff131b89
16 changed files with 149 additions and 6 deletions
+52
View File
@@ -506,3 +506,55 @@ void MakeVowelLists(void)
LoadVoice(voice_name,0); // reset the original phoneme table
delete progress;
}
extern int n_envelopes;
extern char envelope_paths[][80];
extern unsigned char envelope_dat[][128];
#define HT_ENV 140
#define WD_ENV 128*2
void DrawEnvelopes()
{//================
int ix_env;
int y_base;
int x;
unsigned char *env;
char name[80];
wxBitmap bitmap(WD_ENV,HT_ENV*n_envelopes);
// Create a memory DC
wxMemoryDC dc;
dc.SelectObject(bitmap);
dc.SetBrush(*wxWHITE_BRUSH);
dc.SetFont(*wxSWISS_FONT);
dc.Clear();
for(ix_env=0; ix_env<n_envelopes; ix_env++)
{
y_base = HT_ENV * ix_env;
dc.SetPen(*wxLIGHT_GREY_PEN);
dc.DrawLine(0,y_base+0,256,y_base+0);
dc.DrawLine(0,y_base+64,256,y_base+64);
dc.DrawLine(0,y_base+128,256,y_base+128);
dc.DrawLine(128,y_base+0,128,y_base+128);
dc.SetPen(*wxBLACK_PEN);
strncpy0(name,envelope_paths[ix_env],sizeof(name));
dc.DrawText(wxString(name,wxConvLocal),1,y_base);
env = envelope_dat[ix_env];
y_base = y_base+128;
for(x=0; x<127; x++)
{
dc.DrawLine(x*2, y_base-env[x]/2, (x+1)*2, y_base-env[x+1]/2);
}
}
bitmap.SaveFile(path_phsource+_T("/envelopes.png"),wxBITMAP_TYPE_PNG);
}