The set of active outputs.
More...
List of all members.
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.
|
Detailed Description
This class is designed to store outputs prepared for functioning. It allows silent reloading of the output set and hide any reference to them from other classes.
- See also:
- Output
Member Function Documentation
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.
- Parameters:
-
[in] | familyName | The voice family of requested output |
[in] | langId | The language identifier of requested output |
- Returns:
- The name 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.
- Parameters:
-
[in] | outputName | The name of the output to check |
- Returns:
- Non-zero if specified output exists
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.
- Parameters:
-
[in] | langId | The ID of the language to check family for |
[in] | familyName | The voice family to check |
- Returns:
- Non-zero if corresponding output exists in this set
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.
- Parameters:
-
[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 |
- Returns:
- The generated command line to execute player process
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.
- Parameters:
-
[in] | outputName | The name of the output to generate command line by |
[in] | textItem | The text item to generate command line for |
- Returns:
- Generated synthesizer command line
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.
- Parameters:
-
[in] | outputName | The name of the output to prepare text with |
[in] | textItem | The text item to prepare text for |
- Returns:
- The prepared text
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.
- Parameters:
-
[in] | outputs | New outputs to save |