Browse Source

Expose the CompileIntonations and CompilePhonemeData functions via the espeak_ng.h API.

master
Reece H. Dunn 9 years ago
parent
commit
8b358594f7
3 changed files with 20 additions and 12 deletions
  1. 2
    5
      src/espeakedit.cpp
  2. 6
    0
      src/include/espeak-ng/espeak_ng.h
  3. 12
    7
      src/libespeak-ng/compiledata.c

+ 2
- 5
src/espeakedit.cpp View File

"<a href=\"http://espeak.sourceforge.net/\">http://espeak.sourceforge.net</a><br>" "<a href=\"http://espeak.sourceforge.net/\">http://espeak.sourceforge.net</a><br>"
"Licensed under <a href=\"http://espeak.sourceforge.net/license.html\">GNU General Public License version 3</a></font>"; "Licensed under <a href=\"http://espeak.sourceforge.net/license.html\">GNU General Public License version 3</a></font>";


extern "C" void CompilePhonemeData(long rate, FILE *log);
extern "C" espeak_ng_STATUS CompileIntonation(FILE *log);

int progress_max; int progress_max;
int gui_flag = 0; int gui_flag = 0;


fprintf(stderr, "Failed to load default voice\n"); fprintf(stderr, "Failed to load default voice\n");
exit(1); exit(1);
} }
CompilePhonemeData(22050, stderr);
CompileIntonation(stderr);
espeak_ng_CompilePhonemeData(22050, stderr);
espeak_ng_CompileIntonation(stderr);
} }
exit(0); exit(0);
} }

+ 6
- 0
src/include/espeak-ng/espeak_ng.h View File

ESPEAK_NG_API espeak_ng_STATUS ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_CompileMbrolaVoice(const char *path, FILE *log); espeak_ng_CompileMbrolaVoice(const char *path, FILE *log);


ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_CompilePhonemeData(long rate, FILE *log);

ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_CompileIntonation(FILE *log);

#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

+ 12
- 7
src/libespeak-ng/compiledata.c View File







static void CompilePhonemeData2(const char *source, FILE *log)
static espeak_ng_STATUS CompilePhonemeData2(const char *source, FILE *log)
{//================================================ {//================================================
char fname[sizeof(path_home)+40]; char fname[sizeof(path_home)+40];
sprintf(fname,"%s/../phsource",path_home); sprintf(fname,"%s/../phsource",path_home);
if(!access(fname, 755)) if(!access(fname, 755))
{ {
fprintf(log,"Can't find phoneme source directory: %s\n",fname); fprintf(log,"Can't find phoneme source directory: %s\n",fname);
return;
return ENE_READ_ERROR;
} }


strncpy0(current_fname,source,sizeof(current_fname)); strncpy0(current_fname,source,sizeof(current_fname));
if(f_in == NULL) if(f_in == NULL)
{ {
fprintf(log,"Can't read master phonemes file: %s\n",fname); fprintf(log,"Can't read master phonemes file: %s\n",fname);
return;
return ENE_READ_ERROR;
} }


sprintf(fname,"%s/../phsource/%s",path_home,"error_log"); sprintf(fname,"%s/../phsource/%s",path_home,"error_log");


if(f_phdata==NULL || f_phindex==NULL || f_phtab==NULL) if(f_phdata==NULL || f_phindex==NULL || f_phtab==NULL)
{ {
return;
return ENE_WRITE_ERROR;
} }


sprintf(fname,"%s/../phsource/compile_prog_log",path_home); sprintf(fname,"%s/../phsource/compile_prog_log",path_home);
fclose(f_errors); fclose(f_errors);


ReadPhondataManifest(); ReadPhondataManifest();
return ENS_OK;
} // end of CompilePhonemeData } // end of CompilePhonemeData




} }




espeak_ng_STATUS CompileIntonation(FILE *log)
#pragma GCC visibility push(default)

espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log)
{//===================== {//=====================
int ix; int ix;
char *p; char *p;






void CompilePhonemeData(long rate, FILE *log)
espeak_ng_STATUS espeak_ng_CompilePhonemeData(long rate, FILE *log)
{ {
WavegenInit(rate, 0); WavegenInit(rate, 0);
WavegenSetVoice(voice); WavegenSetVoice(voice);
CompilePhonemeData2("phonemes", log);
return CompilePhonemeData2("phonemes", log);
} }

#pragma GCC visibility pop

Loading…
Cancel
Save