Package rst.tts¶
The tts (text to speech) package contains types describing the production of audio signals containing speech from textual representations of speech.
Messages¶
Message TextToSpeechInstruction¶
-
class
rst.tts.
TextToSpeechInstruction
¶ Instructions to a Text-to-Speech module regarding the production of text.
Code author: Soeren Klett <sklett@techfak.uni-bielefeld.de>
Code author: Birte Carlmeyer <bcarlmey@techfak.uni-bielefeld.de>
-
text
¶ Type: ASCII-STRING
The text to produce in case of PLAY. In all other cases this needs to be empty.
-
prosody
¶ Type: rst.tts.Prosody
Prosody to be applied to everything contained in
text
.
-
playback_option
¶ Type: rst.tts.TextToSpeechInstruction.PlaybackOption
Action to be executed by the Text-to-Speech engine.
-
message TextToSpeechInstruction {
/**
* The text to produce in case of @ref .PlaybackOption.PLAY. In all
* other cases this needs to be empty.
*/
optional string text = 1;
/**
* Prosody to be applied to everything contained in @ref .text.
*/
optional Prosody prosody = 2;
/**
* Possible actions the TTS engine has to perform.
*/
enum PlaybackOption {
/**
* Produce the text given in @ref .text.
* If TTS is already playing a text message, this command
* should be ignored.
*/
PLAY = 0;
/**
* Stop the current production and discard it.
*/
STOP = 1;
/**
* Pause the current production. This allows to resume it using
* @ref .RESUME.
*/
PAUSE = 2;
/**
* Resume a previously pause text production.
* If nothing has been paused before, this should be ignored.
*/
RESUME = 3;
}
/**
* Action to be executed by the Text-to-Speech engine.
*/
optional PlaybackOption playback_option = 3 [default = PLAY];
}
Message PlaybackOption¶
-
class
rst.tts.TextToSpeechInstruction.
PlaybackOption
¶ Possible actions the TTS engine has to perform.
-
PLAY
¶ -
= 0
Produce the text given in
text
. If TTS is already playing a text message, this command should be ignored.
-
STOP
¶ -
= 1
Stop the current production and discard it.
-
PAUSE
¶ -
= 2
Pause the current production. This allows to resume it using RESUME.
-
RESUME
¶ -
= 3
Resume a previously pause text production. If nothing has been paused before, this should be ignored.
-
enum PlaybackOption {
/**
* Produce the text given in @ref .text.
* If TTS is already playing a text message, this command
* should be ignored.
*/
PLAY = 0;
/**
* Stop the current production and discard it.
*/
STOP = 1;
/**
* Pause the current production. This allows to resume it using
* @ref .RESUME.
*/
PAUSE = 2;
/**
* Resume a previously pause text production.
* If nothing has been paused before, this should be ignored.
*/
RESUME = 3;
}
Message Prosody¶
-
class
rst.tts.
Prosody
¶ Describes a prosody for an amount of text. It is assumed that there are application-specific default values for all aspects of the prosody (pitch, range, etc.). The prosody can be expressed either in relation to the baseline values or with absolute values.
All aspects of the prosody are optional. In case an aspect is not defined, an executing TTS engine can decide on these aspects.
Code author: Soeren Klett <sklett@techfak.uni-bielefeld.de>
Code author: Birte Carlmeyer <bcarlmey@techfak.uni-bielefeld.de>
-
pitch
¶ Type: rst.tts.Prosody.Value
The baseline pitch for the contained words.
Absolute and relative values are expressed in Hz.
-
range
¶ Type: rst.tts.Prosody.Value
The pitch range (variability) of the contained words.
Absolute and relative values are expressed in Hz.
-
volume
¶ Type: rst.tts.Prosody.Value
The desired change of volume of the contained words.
Absolute and relative values are expressed in dB.
-
duration
¶ Type: FLOAT32
Unit: second
Constraint:
value >= 0
A value in seconds for the desired time to take to read the contained words.
-
rate
¶ Type: FLOAT32
Constraint:
value >= 0
Relative speech rate given as a percentage of the application-specific base rate.
-
message Prosody {
/**
* Specifies the value for a prosody aspect using multiple possible
* formulations, which are represented by the different attributes
* of the message.
*
* Exactly one of the attributes needs to be set.
*/
message Value {
/**
* Absolute value in the target unit.
*/
optional float absolute = 1;
/**
* Offset to an application-specific default value given in the
* target unit.
*/
optional float relative = 2;
/**
* Percentage of the application-specific default value.
*
* 100% equals 1.0.
*/
// @constraint(value > 0)
optional float percentage = 3 [default = 1];
}
/**
* The baseline pitch for the contained words.
*
* Absolute and relative values are expressed in Hz.
*/
optional Value pitch = 1;
/**
* The pitch range (variability) of the contained words.
*
* Absolute and relative values are expressed in Hz.
*/
optional Value range = 2;
/**
* The desired change of volume of the contained words.
*
* Absolute and relative values are expressed in dB.
*/
optional Value volume = 3;
/**
* A value in seconds for the desired time to take to read the
* contained words.
*/
// @unit(second)
// @constraint(value >= 0)
optional float duration = 4;
/**
* Relative speech rate given as a percentage of the
* application-specific base rate.
*/
// @constraint(value >= 0)
optional float rate = 5 [default = 1];
}
Message Value¶
-
class
rst.tts.Prosody.
Value
¶ Specifies the value for a prosody aspect using multiple possible formulations, which are represented by the different attributes of the message.
Exactly one of the attributes needs to be set.
-
absolute
¶ Type: FLOAT32
Absolute value in the target unit.
-
relative
¶ Type: FLOAT32
Offset to an application-specific default value given in the target unit.
-
percentage
¶ Type: FLOAT32
Constraint:
value > 0
Percentage of the application-specific default value.
100% equals 1.0.
-
message Value {
/**
* Absolute value in the target unit.
*/
optional float absolute = 1;
/**
* Offset to an application-specific default value given in the
* target unit.
*/
optional float relative = 2;
/**
* Percentage of the application-specific default value.
*
* 100% equals 1.0.
*/
// @constraint(value > 0)
optional float percentage = 3 [default = 1];
}