eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

voice.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (C) 2005 to 2007 by Jonathan Duddington
  3. * email: [email protected]
  4. * Copyright (C) 2015 Reece H. Dunn
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ESPEAK_NG_VOICE_H
  20. #define ESPEAK_NG_VOICE_H
  21. #include <espeak-ng/espeak_ng.h>
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. #define N_PEAKS 9
  27. typedef struct {
  28. char v_name[40];
  29. char language_name[20];
  30. int phoneme_tab_ix; // phoneme table number
  31. int pitch_base; // Hz<<12
  32. int pitch_range; // standard = 0x1000
  33. int speedf1;
  34. int speedf2;
  35. int speedf3;
  36. int speed_percent; // adjust the WPM speed by this percentage
  37. int flutter;
  38. int roughness;
  39. int echo_delay;
  40. int echo_amp;
  41. int n_harmonic_peaks; // highest formant which is formed from adding harmonics
  42. int peak_shape; // alternative shape for formant peaks (0=standard 1=squarer)
  43. int voicing; // 100% = 64, level of formant-synthesized sound
  44. int formant_factor; // adjust nominal formant frequencies by this because of the voice's pitch (256ths)
  45. int consonant_amp; // amplitude of unvoiced consonants
  46. int consonant_ampv; // amplitude of the noise component of voiced consonants
  47. int samplerate;
  48. int klattv[8];
  49. // parameters used by Wavegen
  50. short freq[N_PEAKS]; // 100% = 256
  51. short height[N_PEAKS]; // 100% = 256
  52. short width[N_PEAKS]; // 100% = 256
  53. short freqadd[N_PEAKS]; // Hz
  54. // copies without temporary adjustments from embedded commands
  55. short freq2[N_PEAKS]; // 100% = 256
  56. short height2[N_PEAKS]; // 100% = 256
  57. short width2[N_PEAKS]; // 100% = 256
  58. int breath[N_PEAKS]; // amount of breath for each formant. breath[0] indicates whether any are set.
  59. int breathw[N_PEAKS]; // width of each breath formant
  60. // This table provides the opportunity for tone control.
  61. // Adjustment of harmonic amplitudes, steps of 8Hz
  62. // value of 128 means no change
  63. #define N_TONE_ADJUST 1000
  64. unsigned char tone_adjust[N_TONE_ADJUST]; // 8Hz steps * 1000 = 8kHz
  65. } voice_t;
  66. extern espeak_VOICE current_voice_selected;
  67. extern voice_t *voice;
  68. extern int tone_points[12];
  69. const char *SelectVoice(espeak_VOICE *voice_select, int *found);
  70. espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name);
  71. voice_t *LoadVoice(const char *voice_name, int control);
  72. voice_t *LoadVoiceVariant(const char *voice_name, int variant);
  73. espeak_ng_STATUS DoVoiceChange(voice_t *v);
  74. void WavegenSetVoice(voice_t *v);
  75. void ReadTonePoints(char *string, int *tone_pts);
  76. void VoiceReset(int control);
  77. void FreeVoiceList(void);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif