Topics

[espeak-ng:master] reported: SetParameter() returns EINVAL for espeakPUNCTUATION and espeakCAPITALS #github

espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #387 SetParameter() returns EINVAL for espeakPUNCTUATION and espeakCAPITALS
By jaacoppi:

The patch seems valid. However, SetParameter() seems to have other issues.

/usr/include/espeak-ng/speak_lib.h defines the API for SetParameter() and the enum espeak_PARAMETER used as an argument to it.

Some enums (such as espeakLINELENGTH and espeakINTONATION) are reserved for internal use. SetParameter() currently handles those even though the API documentation doesn't mention them. There are two options: 1. Remove the undocumented options fromSetParameter(). 2. Modify API documentation so all values of espeak_PARAMETER are handled by SetParameter()

Also, SetParameter() does input validation like if (parameter < 5) and if (new_value > 99) new_value = 99. Should espeakPUNCTUATION and espeakCAPITALS also be validated, and how would it be done? Or should all invalid input be rejected with an error message?

espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #387 SetParameter() returns EINVAL for espeakPUNCTUATION and espeakCAPITALS
By jaacoppi:

The patch seems valid. However, SetParameter() seems to have other issues.

/usr/include/espeak-ng/speak_lib.h defines the API for SetParameter() and the enum espeak_PARAMETER used as an argument to it.

espeakLINELENGTH is reserved for internal use but SetParameter() currently handles it. espeakINTONATION is handled even though the API documentation doesn't mention it. There are a few options: 1. Modify API documentation so all values of espeak_PARAMETER are handled by SetParameter() 2. Only handle the values not reserved for internal use and document them.

Also, SetParameter() does input validation like if (parameter < 5) and if (new_value > 99) new_value = 99. Should espeakPUNCTUATION and espeakCAPITALS also be validated, and how would it be done? Or should all invalid input be rejected with an error message?