This class is the parameters parser for class KokoroSpeechSynthesizer. More...
Inheritance diagram for KokoroSpeechSynthesizer_ParamsParser:Classes | |
| struct | parser_version_type |
Public Member Functions | |
| KokoroSpeechSynthesizer_ParamsParser () | |
| ~KokoroSpeechSynthesizer_ParamsParser () override=default | |
| bool | parseParams (const yarp::os::Searchable &config) override |
| Parse the DeviceDriver parameters. | |
| std::string | getDeviceClassName () const override |
| Get the name of the DeviceDriver class. | |
| std::string | getDeviceName () const override |
| Get the name of the device (i.e. | |
| std::string | getDocumentationOfDeviceParams () const override |
| Get the documentation of the DeviceDriver's parameters. | |
| std::vector< std::string > | getListOfParams () const override |
| Return a list of all params used by the device. | |
| bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
| Return the value (represented as a string) of the requested parameter. | |
| std::string | getConfiguration () const override |
| Return the configuration of the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
| virtual | ~IDeviceDriverParams () |
Public Attributes | |
| const std::string | m_device_classname = {"KokoroSpeechSynthesizer"} |
| const std::string | m_device_name = {"kokoroSpeechSynthesizer"} |
| bool | m_parser_is_strict = false |
| const parser_version_type | m_parser_version = {} |
| std::string | m_provided_configuration |
| const std::string | m_python_executable_defaultValue = {"python3"} |
| const std::string | m_worker_script_defaultValue = {""} |
| const std::string | m_model_repository_defaultValue = {"hexgrad/Kokoro-82M"} |
| const std::string | m_torch_device_defaultValue = {""} |
| const std::string | m_language_defaultValue = {"en"} |
| const std::string | m_voice_defaultValue = {"auto"} |
| const std::string | m_speed_defaultValue = {"1"} |
| const std::string | m_pitch_defaultValue = {"0"} |
| std::string | m_python_executable = {"python3"} |
| std::string | m_worker_script = {} |
| std::string | m_model_repository = {"hexgrad/Kokoro-82M"} |
| std::string | m_torch_device = {} |
| std::string | m_language = {"en"} |
| std::string | m_voice = {"auto"} |
| double | m_speed = {1} |
| double | m_pitch = {0} |
This class is the parameters parser for class KokoroSpeechSynthesizer.
These are the used parameters:
| Group name | Parameter name | Type | Units | Default Value | Required | Description | Notes |
|---|---|---|---|---|---|---|---|
| - | python_executable | string | - | python3 | 0 | Python interpreter containing the kokoro package. | - |
| - | worker_script | string | - | - | 0 | Path to kokoro_worker.py. If omitted, the build or installed worker is used. | - |
| - | model_repository | string | - | hexgrad/Kokoro-82M | 0 | Hugging Face model repository used by Kokoro. | - |
| - | torch_device | string | - | - | 0 | PyTorch execution device, for example cpu or cuda. The empty value lets PyTorch/Kokoro choose automatically. | - |
| - | language | string | - | en | 0 | Speech language: en, en-gb, es, fr, hi, it, ja, pt-br, zh, or a Kokoro language code. | - |
| - | voice | string | - | auto | 0 | Kokoro voice name, for example af_heart or bf_emma. | - |
| - | speed | double | - | 1 | 0 | Speech speed in the range (0, 4]. | - |
| - | pitch | double | - | 0 | 0 | Stored for ISpeechSynthesizer compatibility. Kokoro currently does not apply pitch. | - |
The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):
Definition at line 48 of file KokoroSpeechSynthesizer_ParamsParser.h.
| KokoroSpeechSynthesizer_ParamsParser::KokoroSpeechSynthesizer_ParamsParser | ( | ) |
Definition at line 23 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
|
overridedefault |
|
overridevirtual |
Return the configuration of the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 92 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
|
inlineoverridevirtual |
Get the name of the DeviceDriver class.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 86 of file KokoroSpeechSynthesizer_ParamsParser.h.
|
inlineoverridevirtual |
Get the name of the device (i.e.
the plugin name).
Implements yarp::dev::IDeviceDriverParams.
Definition at line 87 of file KokoroSpeechSynthesizer_ParamsParser.h.
|
overridevirtual |
Get the documentation of the DeviceDriver's parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 253 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
|
overridevirtual |
Return a list of all params used by the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 28 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
|
overridevirtual |
Return the value (represented as a string) of the requested parameter.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 43 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
|
overridevirtual |
Parse the DeviceDriver parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 102 of file KokoroSpeechSynthesizer_ParamsParser.cpp.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_device_classname = {"KokoroSpeechSynthesizer"} |
Definition at line 55 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_device_name = {"kokoroSpeechSynthesizer"} |
Definition at line 56 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_language = {"en"} |
Definition at line 80 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_language_defaultValue = {"en"} |
Definition at line 71 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_model_repository = {"hexgrad/Kokoro-82M"} |
Definition at line 78 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_model_repository_defaultValue = {"hexgrad/Kokoro-82M"} |
Definition at line 69 of file KokoroSpeechSynthesizer_ParamsParser.h.
| bool KokoroSpeechSynthesizer_ParamsParser::m_parser_is_strict = false |
Definition at line 57 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const parser_version_type KokoroSpeechSynthesizer_ParamsParser::m_parser_version = {} |
Definition at line 63 of file KokoroSpeechSynthesizer_ParamsParser.h.
| double KokoroSpeechSynthesizer_ParamsParser::m_pitch = {0} |
Definition at line 83 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_pitch_defaultValue = {"0"} |
Definition at line 74 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_provided_configuration |
Definition at line 65 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_python_executable = {"python3"} |
Definition at line 76 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_python_executable_defaultValue = {"python3"} |
Definition at line 67 of file KokoroSpeechSynthesizer_ParamsParser.h.
| double KokoroSpeechSynthesizer_ParamsParser::m_speed = {1} |
Definition at line 82 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_speed_defaultValue = {"1"} |
Definition at line 73 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_torch_device = {} |
Definition at line 79 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_torch_device_defaultValue = {""} |
Definition at line 70 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_voice = {"auto"} |
Definition at line 81 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_voice_defaultValue = {"auto"} |
Definition at line 72 of file KokoroSpeechSynthesizer_ParamsParser.h.
| std::string KokoroSpeechSynthesizer_ParamsParser::m_worker_script = {} |
Definition at line 77 of file KokoroSpeechSynthesizer_ParamsParser.h.
| const std::string KokoroSpeechSynthesizer_ParamsParser::m_worker_script_defaultValue = {""} |
Definition at line 68 of file KokoroSpeechSynthesizer_ParamsParser.h.