SVoice(path)
Load a voice, from the voice configuration at the given path. If any of the voice’s data objects have already been loaded, then they are shared. This reduces the need for multiple redundant calls.
Parameters: | path (str) – The name of the voice configuration file to load. |
---|---|
Returns: | Voice object |
Return type: | SVoice |
Raises : | RuntimeError if Speect was unable to load the voice. |
Note : | The path can be an absolute or relative path to the voice configuration file. |
Note
The SVoice object inherits from SObject in the Speect Engine and can therefore be used in functions/methods that require parameters of type SObject.
See also
SVoice.synth(input[[, utt_type]) | Synthesize an utterance of the given utterance type with the voice. |
SVoice.resynth(utt, utt_type) | Re-synthesize an utterance with the given utterance type. |
SVoice.name() | Get the voice’s name. |
SVoice.description() | Get the voice’s description. |
SVoice.gender() | Get the voice’s gender. |
SVoice.language() | Get the voice’s language. |
SVoice.lang_code() | Get the voice’s ISO 639-2 language code. |
SVoice.version() | Get the voice’s version. |
SVoice.features | Get the features that are defined for the utterance processor. |
SVoice.dataObjects | Get a list of keys of the data objects that are defined for the voice. |
SVoice.data_get(key) | Return the voice data object reference by the given key. |
SVoice.data_set(key, object) | Set a data object, with the given key, in the voice. |
SVoice.data_del(key) | Delete the voice data object referenced by the given key. |
SVoice.uttTypes | Get a list of keys of the utterance types that are defined for the voice. |
SVoice.uttType_get(key) | Return the voice utterance type definition reference by the given key. |
SVoice.uttType_set(key, uttType) | Set an utterance type definition, with the given key, in the voice. |
SVoice.uttType_del(key) | Delete the voice utterance type definition referenced by the given key. |
SVoice.uttProcessors | Get a list of keys of the utterance processors that are defined for the voice. |
SVoice.uttProcessor_get(key) | Return the voice utterance processor reference by the given key. |
SVoice.uttProcessor_set(key, uttProc) | Set an utterance processor, with the given key, in the voice. |
SVoice.uttProcessor_del(key) | Delete the voice utterance processor referenced by the given key. |
SVoice.featProcessors | Get a list of keys of the feature processors that are defined for the voice. |
SVoice.featProcessor_get(key) | Return the voice feature processor reference by the given key. |
SVoice.featProcessor_set(key, featProc) | Set a feature processor, with the given key, in the voice. |
SVoice.featProcessor_del(key) | Delete the voice feature processor referenced by the given key. |
Methods relating to voice synthesis:
synth(input[, utt_type=’text’])
Synthesize an utterance of the given utterance type with the voice.
Parameters: |
|
---|---|
Returns: | The synthesized utterance. |
Return type: |
resynth(utt, utt_type)
Re-synthesize an utterance with the given utterance type. This is used when an utterance was synthesized with a certain utterance type, and now it must be synthesized with a different utterance type.
Parameters: |
|
---|
Methods relating to a description of the voice:
name()
Get the voice’s name.
Returns: | The name of the voice. |
---|---|
Return type: | str |
description()
Get the voice’s description.
Returns: | The description of the voice. |
---|---|
Return type: | str |
gender()
Get the voice’s gender.
Returns: | The gender of the voice. |
---|---|
Return type: | str |
language()
Get the voice’s language.
Returns: | The language of the voice. |
---|---|
Return type: | str |
lang_code()
Get the voice’s ISO 639-2 language code.
Returns: | The ISO 639-2 language code of the voice. |
---|---|
Return type: | str |
version()
Get the voice’s version.
Returns: | The version of the voice (major, minor). |
---|---|
Return type: | tuple |
An voice has features which can be accessed by:
Get the features that are defined for the voice.
Returns: | A map of the voice features. |
---|---|
Return type: | SMap |
For example:
config_file = voice.features["config_file"]
See SMap for the implemented operations.
Methods relating to the voice’s data:
Get a list of keys of the data objects that are defined for the voice.
Returns: | A list of keys of the data objects defined for the voice. |
---|---|
Return type: | SList |
data_get(key)
Return the voice data object reference by the given key.
Parameters: | key (str) – The key of the data object as referenced in the voice. |
---|---|
Returns: | The data object or None if no such object exists. |
data_set(key, object)
Set a data object, with the given key, in the voice.
Parameters: | key (str) – The key of the data object. |
---|---|
Note : | If the given key references a data object present in the voice, then that data object will be deleted. |
data_del(key)
Delete the voice data object referenced by the given key.
Parameters: | key (str) – The key of the data object. |
---|
Methods relating to the voice’s utterance types:
Get a list of keys of the utterance types that are defined for the voice.
Returns: | A list of keys of the utterance types defined for the voice. |
---|---|
Return type: | SList |
uttType_get(key)
Return the voice utterance type definition reference by the given key.
Parameters: | key (str) – The key of the utterance type definition as referenced in the voice. |
---|---|
Returns: | The utterance type definition or None if no such definition exists. |
Return type: | SList or list |
uttType_set(key, uttType)
Set an utterance type definition, with the given key, in the voice.
Parameters: |
|
---|
uttType_del(key)
Delete the voice utterance type definition referenced by the given key.
Parameters: | key (str) – The key of the utterance type definition. |
---|
Methods relating to the voice’s utterance processors:
Get a list of keys of the utterance processors that are defined for the voice.
Returns: | A list of keys of the utterance processors defined for the voice. |
---|---|
Return type: | SList |
uttProcessor_get(key)
Return the voice utterance processor reference by the given key.
Parameters: | key (str) – The key of the utterance processor as referenced in the voice. |
---|---|
Returns: | The utterance processor or None if no such definition exists. |
Return type: | SUttProcessor |
uttProcessor_set(key, uttProc)
Set an utterance processor, with the given key, in the voice.
Parameters: |
|
---|
uttProcessor_del(key)
Delete the voice utterance processor referenced by the given key.
Parameters: | key (str) – The key of the utterance processor. |
---|
Methods relating to the voice’s feature processors:
Get a list of keys of the feature processors that are defined for the voice.
Returns: | A list of keys of the feature processors defined for the voice. |
---|---|
Return type: | SList |
featProcessor_get(key)
Return the voice feature processor reference by the given key.
Parameters: | key (str) – The key of the feature processor as referenced in the voice. |
---|---|
Returns: | The feature processor or None if no such definition exists. |
Return type: | SFeatProcessor |
featProcessor_set(key, featProc)
Set a feature processor, with the given key, in the voice.
Parameters: |
|
---|
featProcessor_del(key)
Delete the voice feature processor referenced by the given key.
Parameters: | key (str) – The key of the feature processor. |
---|