Table Of Contents

Previous topic

SPlugin

Next topic

Speect Plug-ins Python API

SVoice

class speect.SVoice(*args)

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

Voices

Summary

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.

Synthesis

Methods relating to voice synthesis:

SVoice.synth()

synth(input[, utt_type=’text’])

Synthesize an utterance of the given utterance type with the voice.

Parameters:
  • input (str) – The text to synthesize.
  • utt_type (str) – The utterance type to synthesize.
Returns:

The synthesized utterance.

Return type:

SUtterance

SVoice.resynth()

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:
  • utt (SUtterance) – The utterance to re-synthesize.
  • utt_type (str) – The utterance type for re-synthesis.

Description

Methods relating to a description of the voice:

SVoice.name()

name()

Get the voice’s name.

Returns:The name of the voice.
Return type:str
SVoice.description()

description()

Get the voice’s description.

Returns:The description of the voice.
Return type:str
SVoice.gender()

gender()

Get the voice’s gender.

Returns:The gender of the voice.
Return type:str
SVoice.language()

language()

Get the voice’s language.

Returns:The language of the voice.
Return type:str
SVoice.lang_code()

lang_code()

Get the voice’s ISO 639-2 language code.

Returns:The ISO 639-2 language code of the voice.
Return type:str
SVoice.version()

version()

Get the voice’s version.

Returns:The version of the voice (major, minor).
Return type:tuple

Features

An voice has features which can be accessed by:

SVoice.features

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.

Data

Methods relating to the voice’s data:

SVoice.dataObjects

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
SVoice.data_get()

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.
SVoice.data_set()

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.
SVoice.data_del()

data_del(key)

Delete the voice data object referenced by the given key.

Parameters:key (str) – The key of the data object.

Utterance Types

Methods relating to the voice’s utterance types:

SVoice.uttTypes

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
SVoice.uttType_get()

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
SVoice.uttType_set()

uttType_set(key, uttType)

Set an utterance type definition, with the given key, in the voice.

Parameters:
  • key (str) – The key of the utterance type.
  • uttType (list) – The utterance type definition.
SVoice.uttType_del()

uttType_del(key)

Delete the voice utterance type definition referenced by the given key.

Parameters:key (str) – The key of the utterance type definition.

Utterance Processors

Methods relating to the voice’s utterance processors:

SVoice.uttProcessors

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
SVoice.uttProcessor_get()

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
SVoice.uttProcessor_set()

uttProcessor_set(key, uttProc)

Set an utterance processor, with the given key, in the voice.

Parameters:
  • key (str) – The key of the utterance processor.
  • uttProc (SUttProcessor) – The utterance processor.
SVoice.uttProcessor_del()

uttProcessor_del(key)

Delete the voice utterance processor referenced by the given key.

Parameters:key (str) – The key of the utterance processor.

Feature Processors

Methods relating to the voice’s feature processors:

SVoice.featProcessors

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
SVoice.featProcessor_get()

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
SVoice.featProcessor_set()

featProcessor_set(key, featProc)

Set a feature processor, with the given key, in the voice.

Parameters:
  • key (str) – The key of the feature processor.
  • featProc (SFeatProcessor) – The feature processor.
SVoice.featProcessor_del()

featProcessor_del(key)

Delete the voice feature processor referenced by the given key.

Parameters:key (str) – The key of the feature processor.