| { | { | ||||
| (void)size; // unused | (void)size; // unused | ||||
| if (f_logespeak) { | |||||
| fprintf(f_logespeak, "\nSYNTH posn %d %d %d flags 0x%x\n%s\n", position, end_position, position_type, flags, (const char *)text); | |||||
| fflush(f_logespeak); | |||||
| } | |||||
| espeak_ERROR a_error = EE_INTERNAL_ERROR; | espeak_ERROR a_error = EE_INTERNAL_ERROR; | ||||
| static unsigned int temp_identifier; | static unsigned int temp_identifier; | ||||
| espeak_ERROR a_error = EE_OK; | espeak_ERROR a_error = EE_OK; | ||||
| static unsigned int temp_identifier; | static unsigned int temp_identifier; | ||||
| if (f_logespeak) | |||||
| fprintf(f_logespeak, "\nSYNTH MARK %s posn %d flags 0x%x\n%s\n", index_mark, end_position, flags, (const char *)text); | |||||
| if (unique_identifier == NULL) | if (unique_identifier == NULL) | ||||
| unique_identifier = &temp_identifier; | unique_identifier = &temp_identifier; | ||||
| *unique_identifier = 0; | *unique_identifier = 0; | ||||
| ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative) | ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative) | ||||
| { | { | ||||
| if (f_logespeak) | |||||
| fprintf(f_logespeak, "SETPARAM %d %d %d\n", parameter, value, relative); | |||||
| #ifdef USE_ASYNC | #ifdef USE_ASYNC | ||||
| espeak_ERROR a_error; | espeak_ERROR a_error; | ||||
| FreePhData(); | FreePhData(); | ||||
| FreeVoiceList(); | FreeVoiceList(); | ||||
| if (f_logespeak) { | |||||
| fclose(f_logespeak); | |||||
| f_logespeak = NULL; | |||||
| } | |||||
| return EE_OK; | return EE_OK; | ||||
| } | } | ||||
| const int version_phdata = 0x014801; | const int version_phdata = 0x014801; | ||||
| int option_device_number = -1; | int option_device_number = -1; | ||||
| FILE *f_logespeak = NULL; | |||||
| int logging_type; | |||||
| // copy the current phoneme table into here | // copy the current phoneme table into here | ||||
| int n_phoneme_tab; | int n_phoneme_tab; | ||||
| char *p; | char *p; | ||||
| char string[200]; | char string[200]; | ||||
| logging_type = 0; | |||||
| for (ix = 0; ix < N_SOUNDICON_SLOTS; ix++) { | for (ix = 0; ix < N_SOUNDICON_SLOTS; ix++) { | ||||
| soundicon_tab[ix].filename = NULL; | soundicon_tab[ix].filename = NULL; | ||||
| soundicon_tab[ix].data = NULL; | soundicon_tab[ix].data = NULL; | ||||
| while (fgets(buf, sizeof(buf), f) != NULL) { | while (fgets(buf, sizeof(buf), f) != NULL) { | ||||
| if (buf[0] == '/') continue; | if (buf[0] == '/') continue; | ||||
| if (memcmp(buf, "log", 3) == 0) { | |||||
| if (sscanf(&buf[4], "%d %s", &logging_type, string) == 2) { | |||||
| if (f_logespeak) | |||||
| fclose(f_logespeak); | |||||
| f_logespeak = fopen(string, "w"); | |||||
| } | |||||
| } else if (memcmp(buf, "tone", 4) == 0) | |||||
| if (memcmp(buf, "tone", 4) == 0) | |||||
| ReadTonePoints(&buf[5], tone_points); | ReadTonePoints(&buf[5], tone_points); | ||||
| else if (memcmp(buf, "pa_device", 9) == 0) | else if (memcmp(buf, "pa_device", 9) == 0) | ||||
| sscanf(&buf[10], "%d", &option_device_number); | sscanf(&buf[10], "%d", &option_device_number); |
| char word_replaced[N_WORD_BYTES+1]; | char word_replaced[N_WORD_BYTES+1]; | ||||
| char old_dictionary_name[40]; | char old_dictionary_name[40]; | ||||
| if ((f_logespeak != NULL) && (logging_type & 8)) { | |||||
| fprintf(f_logespeak, "WORD: flg=%.5x len=%d '", wtab->flags, wtab->length); | |||||
| for (ix = 0; ix < 40; ix++) { | |||||
| if (word[ix] == 0) break; | |||||
| fputc(word[ix], f_logespeak); | |||||
| } | |||||
| fprintf(f_logespeak, "'\n"); | |||||
| } | |||||
| len = wtab->length; | len = wtab->length; | ||||
| if (len > 31) len = 31; | if (len > 31) len = 31; | ||||
| source_ix = (wtab->sourceix & 0x7ff) | (len << 11); // bits 0-10 sourceix, bits 11-15 word length | source_ix = (wtab->sourceix & 0x7ff) | (len << 11); // bits 0-10 sourceix, bits 11-15 word length | ||||
| charix[ix] = 0; | charix[ix] = 0; | ||||
| terminator = ReadClause(tr, f_text, source, charix, &charix_top, N_TR_SOURCE, &tone2, voice_change_name); | terminator = ReadClause(tr, f_text, source, charix, &charix_top, N_TR_SOURCE, &tone2, voice_change_name); | ||||
| if ((f_logespeak != NULL) && (logging_type & 4)) { | |||||
| fprintf(f_logespeak, "CLAUSE %x:\n", terminator); | |||||
| for (p = source; *p != 0; p++) | |||||
| fputc(*p, f_logespeak); | |||||
| fprintf(f_logespeak, "ENDCLAUSE\n"); | |||||
| fflush(f_logespeak); | |||||
| } | |||||
| p = source; | p = source; | ||||
| charix[charix_top+1] = 0; | charix[charix_top+1] = 0; |
| char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int use_ipa, int *flags); | char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int use_ipa, int *flags); | ||||
| extern FILE *f_trans; // for logging | extern FILE *f_trans; // for logging | ||||
| extern FILE *f_logespeak; | |||||
| extern int logging_type; // from config file | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } |