Package io.micronaut.aws.alexa.ssml
Class Ssml
java.lang.Object
io.micronaut.aws.alexa.ssml.Ssml
Speech Synthesis Markup Language builder.
- Since:
- 2.0.0
- Author:
- sdelamo
- See Also:
-
- SSML.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe audio tag lets you provide the URL for an MP3 file that the Alexa service can play while rendering a response.breakWithMilliseconds
(@NonNull Integer milliseconds) breakWithSeconds
(@NonNull Integer seconds) breakWithStrength
(@NonNull BreakStrength strength) build()
domain
(@NonNull AmazonDomain domain, @NonNull String text) Applies different speaking styles to the speech.effect
(@NonNull AmazonEffect effect, @NonNull String text) Applies Amazon-specific effect to the speech.emotion
(@NonNull AmazonEmotion emotion, @NonNull AmazonEmotionIntensity intensity, @NonNull String text) emphasis
(@NonNull String text, @Nullable EmphasisLevel emphasisLevel) lang
(@NonNull String text, @NonNull SupportedLang lang) prosody
(@NonNull String text, @Nullable ProsodyRate rate, @Nullable ProsodyPitch pitch, @Nullable ProsodyVolume volume) sayAs
(@NonNull String text, @NonNull InterpretAs interpretAs, @Nullable InterpretAsDateFormat interpretAsDateFormat)
-
Field Details
-
ATTRIBUTE_NAME
- See Also:
-
OPEN_TAG
- See Also:
-
CLOSE_TAG
- See Also:
-
OPEN_CLOSE_TAG
- See Also:
-
CLOSE_OPENING_TAG
- See Also:
-
INTERPRET_AS
- See Also:
-
FORMAT
- See Also:
-
TAG_AMAZON_DOMAIN
- See Also:
-
TAG_AMAZON_EFFECT
- See Also:
-
TAG_AMAZON_EMOTION
- See Also:
-
TAG_AUDIO
- See Also:
-
TAG_BREAK
- See Also:
-
TAG_EMPHASIS
- See Also:
-
TAG_LANG
- See Also:
-
TAG_P
- See Also:
-
TAG_PHONEME
- See Also:
-
TAG_PROSODY
- See Also:
-
TAG_S
- See Also:
-
TAG_SAY_AS
- See Also:
-
TAG_SPEAK
- See Also:
-
TAG_SUB
- See Also:
-
TAG_VOICE
- See Also:
-
TAG_W
- See Also:
-
XML_LANG
- See Also:
-
RATE
- See Also:
-
PITCH
- See Also:
-
VOLUME
- See Also:
-
SRC
- See Also:
-
-
Constructor Details
-
Ssml
public Ssml()Constructor. -
Ssml
- Parameters:
text
- plain text
-
-
Method Details
-
domain
Applies different speaking styles to the speech. The styles are curated text-to-speech voices that employ different variations of intonation, emphasis, pausing and other techniques to match the speech to the type of content. For example, the news style makes Alexa's voice sound like what you might expect to hear in a TV or radio newscast, and was built primarily for customers to listen to news articles and other news-based content.- Parameters:
domain
- Name of the speaking style to apply to the speechtext
- Text to be wrapped inside the amazon:domain tag- Returns:
- An SsmlBuilder with an amazon:domain tag.
-
audio
The audio tag lets you provide the URL for an MP3 file that the Alexa service can play while rendering a response.- Parameters:
src
- Specifies the URL for the MP3 file- Returns:
- SSML Builder
-
effect
Applies Amazon-specific effect to the speech.- Parameters:
effect
- Effecttext
- text to apply the effect to- Returns:
- Text wrapped in amazon:effect tag
-
text
- Parameters:
text
- plain text- Returns:
- Return builder
-
emotion
public Ssml emotion(@NonNull @NonNull AmazonEmotion emotion, @NonNull @NonNull AmazonEmotionIntensity intensity, @NonNull @NonNull String text) - Parameters:
emotion
- The name of the emotion to apply to the speechintensity
- The intensity or strength of teh emotion to express.text
- plain text to apply emotion to- Returns:
- SSML builder
-
lang
- Parameters:
text
- text to speak tagged as a particular langlang
- specify the language model and rules to speak the tagged content- Returns:
- SSML Builder
-
paragraph
- Parameters:
text
- text to be wrapped in a paragraph- Returns:
- SSML builder
-
prosody
public Ssml prosody(@NonNull @NonNull String text, @Nullable @Nullable ProsodyRate rate, @Nullable @Nullable ProsodyPitch pitch, @Nullable @Nullable ProsodyVolume volume) - Parameters:
text
- text to be wrapped in the prosody tagrate
- Rate of Speechpitch
- Tone (pitch) of the speechvolume
- Volume of the Speech- Returns:
- SSML Builder
-
sentence
- Parameters:
text
- Text to be wrapped in a sentence tag (s)- Returns:
- SSML builder
-
speak
- Parameters:
text
- Text to be wrapped in speak tag- Returns:
- SSML Builder
-
s
- Parameters:
text
- Text to be wrapped in a sentence tag (s)- Returns:
- SSML builder
-
p
- Parameters:
text
- Text to be wrapped in a paragraph tag- Returns:
- SSML builder
-
sayAs
public Ssml sayAs(@NonNull @NonNull String text, @NonNull @NonNull InterpretAs interpretAs, @Nullable @Nullable InterpretAsDateFormat interpretAsDateFormat) - Parameters:
text
- text to be wrapped in a say as taginterpretAs
- Indicate alexa how to interpret textinterpretAsDateFormat
- Format to be used when interpret-as is set to date.- Returns:
- SSML Builder
-
w
- Parameters:
text
- Text to be wrappedrole
- Specify role of the word- Returns:
- SSML builder
- See Also:
-
emphasis
public Ssml emphasis(@NonNull @NonNull String text, @Nullable @Nullable EmphasisLevel emphasisLevel) - Parameters:
text
- Text to be emphasizedemphasisLevel
- Emphasis level- Returns:
- SSML builder
-
breakWithSeconds
- Parameters:
seconds
- duration of break in seconds- Returns:
- SSML Builder
- See Also:
-
voice
- Parameters:
text
- text to be spoken in a particular voicevoice
- Amazon Polly voice to speak the text with- Returns:
- SSML Builder
-
sub
- Parameters:
text
- text to be pronouced differentlyalias
- pronunciation to substitute- Returns:
- SSML
-
breakWithMilliseconds
- Parameters:
milliseconds
- duration of break in milliseconds- Returns:
- SSML Builder
- See Also:
-
breakWithStrength
- Parameters:
strength
- Break strength- Returns:
- SSML Builder
- See Also:
-
build
- Returns:
- SSML as String
-