I’m trying to create a wrapper for the eSpeak speech synthesis library, and so far I’ve managed to make simple methods like single character synthesis work. However, the main synthesis method is too complex for me to wrap my head around. Does anyone have a good suggestion for a C# mapping of this method signature? (Especially the first variable!)
ESPEAK_API espeak_ERROR espeak_Synth(const void *text,
size_t size,
unsigned int position,
espeak_POSITION_TYPE position_type,
unsigned int end_position,
unsigned int flags,
unsigned int* unique_identifier,
void* user_data);
espeak_POSITION_TYPE I’ve mapped to an enum and I think it works. The following is the description of the text variable if that is helpful:
text: The text to be spoken, terminated by a zero character. It may be either 8-bit characters,
wide characters (wchar_t), or UTF8 encoding. Which of these is determined by the "flags"
parameter.
It depends.
assuming espeak_ERROR and espeak_POSITION_TYPE are integers:
this should work, if you pass to flags, that text is 8bit (and not UTF).
if you want to pass UTF-8 string.