YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
KokoroSpeechSynthesizer_ParamsParser Class Reference

This class is the parameters parser for class KokoroSpeechSynthesizer. More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/opt-modules/yarp-device-kokoro/src/devices/kokoroSpeechSynthesizer/KokoroSpeechSynthesizer_ParamsParser.h>

+ 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 &paramName, std::string &paramValue) 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}
 

Detailed Description

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):

yarpdev --device kokoroSpeechSynthesizer --python_executable python3 --worker_script <optional_value> --model_repository hexgrad/Kokoro-82M --torch_device <optional_value> --language en --voice auto --speed 1 --pitch 0
yarpdev --device kokoroSpeechSynthesizer

Definition at line 48 of file KokoroSpeechSynthesizer_ParamsParser.h.

Constructor & Destructor Documentation

◆ KokoroSpeechSynthesizer_ParamsParser()

KokoroSpeechSynthesizer_ParamsParser::KokoroSpeechSynthesizer_ParamsParser ( )

Definition at line 23 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

◆ ~KokoroSpeechSynthesizer_ParamsParser()

KokoroSpeechSynthesizer_ParamsParser::~KokoroSpeechSynthesizer_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getConfiguration()

std::string KokoroSpeechSynthesizer_ParamsParser::getConfiguration ( ) const
overridevirtual

Return the configuration of the device.

Returns
The configuration of the device, represented in a string format.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 92 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

◆ getDeviceClassName()

std::string KokoroSpeechSynthesizer_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 86 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ getDeviceName()

std::string KokoroSpeechSynthesizer_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 87 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string KokoroSpeechSynthesizer_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 253 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > KokoroSpeechSynthesizer_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

◆ getParamValue()

bool KokoroSpeechSynthesizer_ParamsParser::getParamValue ( const std::string &  paramName,
std::string &  paramValue 
) const
overridevirtual

Return the value (represented as a string) of the requested parameter.

Returns
True if the requested parameter was succesfully retrieved.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 43 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

◆ parseParams()

bool KokoroSpeechSynthesizer_ParamsParser::parseParams ( const yarp::os::Searchable &  config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 102 of file KokoroSpeechSynthesizer_ParamsParser.cpp.

Member Data Documentation

◆ m_device_classname

const std::string KokoroSpeechSynthesizer_ParamsParser::m_device_classname = {"KokoroSpeechSynthesizer"}

Definition at line 55 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_device_name

const std::string KokoroSpeechSynthesizer_ParamsParser::m_device_name = {"kokoroSpeechSynthesizer"}

Definition at line 56 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_language

std::string KokoroSpeechSynthesizer_ParamsParser::m_language = {"en"}

Definition at line 80 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_language_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_language_defaultValue = {"en"}

Definition at line 71 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_model_repository

std::string KokoroSpeechSynthesizer_ParamsParser::m_model_repository = {"hexgrad/Kokoro-82M"}

Definition at line 78 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_model_repository_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_model_repository_defaultValue = {"hexgrad/Kokoro-82M"}

Definition at line 69 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_parser_is_strict

bool KokoroSpeechSynthesizer_ParamsParser::m_parser_is_strict = false

Definition at line 57 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_parser_version

const parser_version_type KokoroSpeechSynthesizer_ParamsParser::m_parser_version = {}

Definition at line 63 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_pitch

double KokoroSpeechSynthesizer_ParamsParser::m_pitch = {0}

Definition at line 83 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_pitch_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_pitch_defaultValue = {"0"}

Definition at line 74 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_provided_configuration

std::string KokoroSpeechSynthesizer_ParamsParser::m_provided_configuration

Definition at line 65 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_python_executable

std::string KokoroSpeechSynthesizer_ParamsParser::m_python_executable = {"python3"}

Definition at line 76 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_python_executable_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_python_executable_defaultValue = {"python3"}

Definition at line 67 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_speed

double KokoroSpeechSynthesizer_ParamsParser::m_speed = {1}

Definition at line 82 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_speed_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_speed_defaultValue = {"1"}

Definition at line 73 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_torch_device

std::string KokoroSpeechSynthesizer_ParamsParser::m_torch_device = {}

Definition at line 79 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_torch_device_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_torch_device_defaultValue = {""}

Definition at line 70 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_voice

std::string KokoroSpeechSynthesizer_ParamsParser::m_voice = {"auto"}

Definition at line 81 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_voice_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_voice_defaultValue = {"auto"}

Definition at line 72 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_worker_script

std::string KokoroSpeechSynthesizer_ParamsParser::m_worker_script = {}

Definition at line 77 of file KokoroSpeechSynthesizer_ParamsParser.h.

◆ m_worker_script_defaultValue

const std::string KokoroSpeechSynthesizer_ParamsParser::m_worker_script_defaultValue = {""}

Definition at line 68 of file KokoroSpeechSynthesizer_ParamsParser.h.


The documentation for this class was generated from the following files: