From 9ad7973a9b721f1d64a54954253d66ec333c57d4 Mon Sep 17 00:00:00 2001 From: sklett Date: Wed, 18 Nov 2015 10:54:26 +0100 Subject: [PATCH] Created TextToSpeechInstruction.proto --- .../sandbox/rst/tts/TextToSpeechInstruction.proto | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 proto/sandbox/rst/tts/TextToSpeechInstruction.proto diff --git a/proto/sandbox/rst/tts/TextToSpeechInstruction.proto b/proto/sandbox/rst/tts/TextToSpeechInstruction.proto new file mode 100644 index 0000000..580f73e --- /dev/null +++ b/proto/sandbox/rst/tts/TextToSpeechInstruction.proto @@ -0,0 +1,139 @@ +package rst.tts; + +option java_outer_classname = "TextToSpeechInstructionType"; + +/** + * Instructions to a Text-to-Speech module regarding the production of + * text. + * + * @author Soeren Klett + * @author Birte Carlmeyer + */ +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; + + /** + * 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. + */ + 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 { + + /** + * Absolut 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]; + + } + + /** + * Prosody to be applied to everything contained in @ref .text. + */ + optional Prosody prosody = 2; + + 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]; + +} + -- 2.1.0