Browse Source

espeak-ng: Add -P option to configure pitch range

master
Samuel Thibault 2 years ago
parent
commit
b5b3231e52
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      src/espeak-ng.c

+ 9
- 1
src/espeak-ng.c View File

"\t lines less than this length as end-of-clause\n" "\t lines less than this length as end-of-clause\n"
"-p <integer>\n" "-p <integer>\n"
"\t Pitch adjustment, 0 to 99, default is 50\n" "\t Pitch adjustment, 0 to 99, default is 50\n"
"-P <integer>\n"
"\t Pitch range adjustment, 0 to 99, default is 50\n"
"-s <integer>\n" "-s <integer>\n"
"\t Speed in approximate words per minute. The default is 175\n" "\t Speed in approximate words per minute. The default is 175\n"
"-v <voice name>\n" "-v <voice name>\n"
int volume = -1; int volume = -1;
int speed = -1; int speed = -1;
int pitch = -1; int pitch = -1;
int pitch_range = -1;
int wordgap = -1; int wordgap = -1;
int option_capitals = -1; int option_capitals = -1;
int option_punctuation = -1; int option_punctuation = -1;
option_punctlist[0] = 0; option_punctlist[0] = 0;


while (true) { while (true) {
c = getopt_long(argc, argv, "a:b:Dd:f:g:hk:l:mp:qs:v:w:xXz",
c = getopt_long(argc, argv, "a:b:Dd:f:g:hk:l:mp:P:qs:v:w:xXz",
long_options, &option_index); long_options, &option_index);


// Detect the end of the options. // Detect the end of the options.
case 'p': case 'p':
pitch = atoi(optarg2); pitch = atoi(optarg2);
break; break;
case 'P':
pitch_range = atoi(optarg2);
break;
case 'q': case 'q':
quiet = true; quiet = true;
break; break;
espeak_SetParameter(espeakVOLUME, volume, 0); espeak_SetParameter(espeakVOLUME, volume, 0);
if (pitch >= 0) if (pitch >= 0)
espeak_SetParameter(espeakPITCH, pitch, 0); espeak_SetParameter(espeakPITCH, pitch, 0);
if (pitch_range >= 0)
espeak_SetParameter(espeakRANGE, pitch_range, 0);
if (option_capitals >= 0) if (option_capitals >= 0)
espeak_SetParameter(espeakCAPITALS, option_capitals, 0); espeak_SetParameter(espeakCAPITALS, option_capitals, 0);
if (option_punctuation >= 0) if (option_punctuation >= 0)

Loading…
Cancel
Save