Browse Source

Small fixes and voice selection

master
Jeroen Vreeken 3 years ago
parent
commit
fe34877226
4 changed files with 22 additions and 7 deletions
  1. +4
    -3
      dml_trx.c
  2. +1
    -1
      fprs_aprsis.c
  3. +16
    -2
      soundlib.c
  4. +1
    -1
      soundlib.h

+ 4
- 3
dml_trx.c View File

@ -42,8 +42,8 @@
#define DML_TRX_DATA_KEEPALIVE 10
//#define DML_TRX_FPRS_TIMER (10 * 60)
#define DML_TRX_FPRS_TIMER (1 * 60)
#define DML_TRX_FPRS_TIMER (10 * 60)
//#define DML_TRX_FPRS_TIMER (1 * 60)
#define DML_TRX_FPRS_TIMER_INIT (10)
#define DML_TRX_FPRS_DB_TIMER 10
@ -1276,7 +1276,8 @@ int main(int argc, char **argv)
fprs_parse_hook_message(message_cb, NULL);
if (soundlib_init(8000)) {
char *soundlib_voice = dml_config_value("soundlib_voice", NULL, NULL);
if (soundlib_init(8000, soundlib_voice)) {
printf("Could not init soundlib\n");
return -1;
}


+ 1
- 1
fprs_aprsis.c View File

@ -221,8 +221,8 @@ static int aprs_is_cb(void *arg)
line = buffer + i + 1;
}
}
pos = i - (line - buffer);
if (line != buffer + i) {
pos = i - (line - buffer);
memmove(buffer, line, i - pos);
}
} else {


+ 16
- 2
soundlib.c View File

@ -29,6 +29,7 @@
cst_voice *register_cmu_us_slt(void);
static cst_voice *flite_voice;
static char *voice = NULL;
static char *spell(char c)
{
@ -303,12 +304,25 @@ uint8_t *soundlib_synthesize(char *text, size_t *size)
}
#endif
int soundlib_init(int init_rate)
int soundlib_init(int init_rate, char *init_voice)
{
rate = init_rate;
voice = init_voice;
#ifdef HAVE_FLITE
flite_voice = register_cmu_us_slt();
flite_init();
void usenglish_init(cst_voice *v);
cst_lexicon *cmulex_init(void);
flite_add_lang("eng",usenglish_init,cmulex_init);
flite_add_lang("usenglish",usenglish_init,cmulex_init);
if (!voice) {
flite_voice = register_cmu_us_slt();
} else {
flite_voice = flite_voice_load(voice);
}
if (!flite_voice) {
printf("Could not select voice\n");
return -1;


+ 1
- 1
soundlib.h View File

@ -29,6 +29,6 @@ uint8_t *soundlib_get(int nr, size_t *size);
uint8_t *soundlib_synthesize(char *text, size_t *size);
uint8_t *soundlib_spell(char *text, size_t *size);
int soundlib_init(int init_rate);
int soundlib_init(int init_rate, char *init_voice);
#endif /*_INCLUDE_SOUNDLIB_H_ */

Loading…
Cancel
Save