Browse Source

espeak-ng: implement a --compile-mbrola command-line option

master
Reece H. Dunn 9 years ago
parent
commit
6bd44bd926
2 changed files with 18 additions and 1 deletions
  1. 8
    0
      src/espeak-ng.c
  2. 10
    1
      src/libespeak-ng/compiledata.c

+ 8
- 0
src/espeak-ng.c View File

#include <sys/stat.h> #include <sys/stat.h>


#include "speak_lib.h" #include "speak_lib.h"
#include "espeak_ng.h"


#ifndef S_ISDIR #ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
"--compile=<voice name>\n" "--compile=<voice name>\n"
"\t Compile pronunciation rules and dictionary from the current\n" "\t Compile pronunciation rules and dictionary from the current\n"
"\t directory. <voice name> specifies the language\n" "\t directory. <voice name> specifies the language\n"
"--compile-mbrola=<voice name>\n"
"\t Compile an MBROLA voice\n"
"--ipa Write phonemes to stdout using International Phonetic Alphabet\n" "--ipa Write phonemes to stdout using International Phonetic Alphabet\n"
"--path=\"<path>\"\n" "--path=\"<path>\"\n"
"\t Specifies the directory containing the espeak-data directory\n" "\t Specifies the directory containing the espeak-data directory\n"
{"version", no_argument, 0, 0x10b}, {"version", no_argument, 0, 0x10b},
{"sep", optional_argument, 0, 0x10c}, {"sep", optional_argument, 0, 0x10c},
{"tie", optional_argument, 0, 0x10d}, {"tie", optional_argument, 0, 0x10d},
{"compile-mbrola", optional_argument, 0, 0x10e},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };


phonemes_separator = 0x200d; // ZWJ phonemes_separator = 0x200d; // ZWJ
break; break;


case 0x10e: // --compile-mbrola
samplerate = espeak_Initialize(AUDIO_OUTPUT_PLAYBACK,0,data_path,0);
espeak_ng_CompileMbrolaVoice(optarg2, stdout);
exit(0);


default: default:
exit(0); exit(0);

+ 10
- 1
src/libespeak-ng/compiledata.c View File

***************************************************************************/ ***************************************************************************/


#include <stdio.h> #include <stdio.h>
#include <unistd.h>


#include "speak_lib.h" #include "speak_lib.h"
#include "espeak_ng.h" #include "espeak_ng.h"
#include "speech.h" #include "speech.h"
#include "synthesize.h" #include "synthesize.h"


static const char *basename(const char *filename)
{
const char *current = filename + strlen(filename);
while (current != filename && !(*current == '/' || *current == '\\'))
--current;
return current == filename ? current : current + 1;
}

static unsigned int StringToWord(const char *string) static unsigned int StringToWord(const char *string)
{ {
// Pack 4 characters into a word // Pack 4 characters into a word
return(word); return(word);
} }


#pragma GCC visibility push(default)
espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *filepath, FILE *log) espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *filepath, FILE *log)
{ {
char *p; char *p;
fprintf(log, "Mbrola translation file: %s -- %d phonemes\n", buf, count); fprintf(log, "Mbrola translation file: %s -- %d phonemes\n", buf, count);
return ENS_OK; return ENS_OK;
} }
#pragma GCC visibility pop

Loading…
Cancel
Save