Public Member Functions | |
std::string | getOutputNameByFamilyAndLangId (const std::string &familyName, LangId langId) const |
Returns the output name corresponding to some voice family and language. | |
bool | hasOutput (const std::string &outputName) const |
Checks output availability by its name. | |
bool | isValidFamilyName (LangId langId, const std::string &familyName) const |
Checks if some family name is valid for some language. | |
OutputSet () | |
The default constructor. | |
std::string | preparePlayerCommand (const std::string &outputName, PlayerType playerType, const TextItem &textItem) const |
Generates command line to play portion of synthesized speech. | |
std::string | prepareSynthCommand (const std::string &outputName, const TextItem &textItem) const |
Prepares the command line to invoke speech synthesizer of specified output. | |
std::string | prepareText (const std::string &outputName, const TextItem &textItem) const |
Prepares text to send to speech synthesizer. | |
void | reinit (const OutputList &outputs) |
Fills set of available outputs with new data. | |
virtual | ~OutputSet () |
The destructor. |
std::string OutputSet::getOutputNameByFamilyAndLangId | ( | const std::string & | familyName, | |
LangId | langId | |||
) | const |
This method looks through stored set of outputs and returns one with corresponding voice family and language properties. It returns the first one as it be found during the search, but this output must exists. Use isValidFamily Name() method to be sure such output exists.
[in] | familyName | The voice family of requested output |
[in] | langId | The language identifier of requested output |
bool OutputSet::hasOutput | ( | const std::string & | outputName | ) | const |
This method allows you to be sure the output set contains an output specified by its name.
[in] | outputName | The name of the output to check |
bool OutputSet::isValidFamilyName | ( | LangId | langId, | |
const std::string & | familyName | |||
) | const |
This method allows you to be sure the is available output with corresponding voice family and associated language properties.
[in] | langId | The ID of the language to check family for |
[in] | familyName | The voice family to check |
std::string OutputSet::preparePlayerCommand | ( | const std::string & | outputName, | |
PlayerType | playerType, | |||
const TextItem & | textItem | |||
) | const |
This method prepares command line to playback portion of synthesized speech. Generated command line must accept audio data through its stdin stream. Each output can contain three command line patterns for three audio subsystems: alsa, pulseaudio and pc speaker. One of the parameters chooses which one of them must be used.
[in] | outputName | The output name to generate command line with |
[in] | playerType | The type of player to use, can be PlayerTypeAlsa, PlayerTypePulseaudio or PlayerTypePcspeaker |
[in] | textItem | The text item to generate command line for |
std::string OutputSet::prepareSynthCommand | ( | const std::string & | outputName, | |
const TextItem & | textItem | |||
) | const |
This method generates a command line required to execute speech synthesizer of some output. All required data is stored in output and TextItem object. Synthesizer command line can contain various parameters as speech volume, pitch and rate.
[in] | outputName | The name of the output to generate command line by |
[in] | textItem | The text item to generate command line for |
std::string OutputSet::prepareText | ( | const std::string & | outputName, | |
const TextItem & | textItem | |||
) | const |
This method makes all required output-specific text transformations to send it to speech synthesizer. It can be any escaping or marks to speak some characters phonetically.
[in] | outputName | The name of the output to prepare text with |
[in] | textItem | The text item to prepare text for |
void OutputSet::reinit | ( | const OutputList & | outputs | ) |
This method sets new list of available outputs. It is called on server configuration reloading and makes it silent and transparent for all classes uses active outputs.
[in] | outputs | New outputs to save |