speech-dispatcher: Information Retrieval Commands in C
4.1.8 Information Retrieval Commands
------------------------------------
-- C API function: char** spd_list_modules(SPDConnection* connection)
Returns a null-terminated array of identification names of the
available output modules. You can subsequently set the desired
output module with ⇒spd_set_output_module. In case of
error, the return value is a NULL pointer.
‘connection’ is the SPDConnection* connection created by
spd_open().
The caller has to call ‘free_spd_modules’ to free the returned
array.
-- C API function: char** spd_list_voices(SPDConnection* connection)
Returns a null-terminated array of identification names of the
symbolic voices. You can subsequently set the desired voice with
⇒spd_set_voice_type.
Please note that this is a fixed list independent of the
synthesizer in use. The given voices can be mapped to specific
synthesizer voices according to user wish or may, for example, all
be mapped to the same voice. To choose directly from the raw list
of voices as implemented in the synthesizer, ⇒
spd_list_synthesis_voices2 can be used.
In case of error, the return value is a NULL pointer.
‘connection’ is the SPDConnection* connection created by
spd_open().
The caller has to call ‘free_spd_symbolic_voices’ to free the
returned array.
-- C API function: char** spd_list_synthesis_voices2(SPDConnection*
connection, const char *language, const char *variant)
Returns a null-terminated array of identification names of
‘SPDVoice*’ structures describing the available voices as given by
the synthesizer. You can subsequently set the desired voice with
‘spd_set_synthesis_voice()’.
When ‘language’ is non-‘NULL’, only the voices matching this
language will be returned. When additionally ‘variant’ is
non-‘NULL’, only the voices matching this language and this variant
will be returned.
typedef struct{
char *name; /* Name of the voice (id) */
char *language; /* 2/3-letter ISO language code,
* possibly followed by 2/3-letter ISO region code,
* e.g. en-US */
char *variant; /* a not-well defined string describing dialect etc. */
}SPDVoice;
Please note that the list returned is specific to each synthesizer
in use (so when you switch to another output module, you must also
retrieve a new list). If you want instead to use symbolic voice
names which are independent of the synthesizer in use, ⇒
spd_list_voices.
In case of error, the return value is a NULL pointer.
‘connection’ is the SPDConnection* connection created by
spd_open().
The caller has to call ‘free_spd_voices’ to free the returned
array.
-- C API function: char** spd_list_synthesis_voices(SPDConnection*
connection, const char *language, const char *variant)
This is equivalent to calling
‘spd_list_synthesis_voices2(connection, NULL, NULL)’.