public class SsmlBuilder
Helper class for construction of SSML https//www.w3.org/TR/speech-synthesis11/ based responses. This Helper only contain the supported SSML tags for Amazon Alexa and the Google Assistant.
| Modifier and Type | Class and Description |
|---|---|
static class |
SsmlBuilder.Companion |
| Modifier and Type | Field and Description |
|---|---|
static SsmlBuilder.Companion |
Companion |
| Constructor and Description |
|---|
SsmlBuilder(java.lang.String text)
Helper class for construction of SSML https//www.w3.org/TR/speech-synthesis11/ based responses.
This Helper only contain the supported SSML tags for Amazon Alexa and the Google Assistant.
|
SsmlBuilder()
Helper class for construction of SSML https//www.w3.org/TR/speech-synthesis11/ based responses.
This Helper only contain the supported SSML tags for Amazon Alexa and the Google Assistant.
|
| Modifier and Type | Method and Description |
|---|---|
SsmlBuilder |
appendAlexaSpeechcon(java.lang.String speechcon)
This will add a
|
SsmlBuilder |
appendAlexaSpeechconRandom(java.lang.String... speechcons)
This will add a
|
SsmlBuilder |
appendAmazonEffect(java.lang.String text,
AmazonEffect amazonEffect)
This will add the <> https//developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html#amazon-effect
tag with the
enum AmazonEffect to a given string. |
SsmlBuilder |
appendAudio(java.lang.String url)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.3.1 tag with the given URL.
|
SsmlBuilder |
appendBreak(Strength strength,
java.lang.Integer timeInMs)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.2.3 tag to the SSML string.
You can either choose to set a
enum Strength, a time in milliseconds or the default for the break. |
SsmlBuilder |
appendEmphasis(Emphasis emphasis,
java.lang.String text)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.2.2 tag with the attribute
enum Emphasis to a given string. |
SsmlBuilder |
appendRandomOf(java.lang.String... text)
This will randomly append one of the given strings to this
class SsmlBuilder |
SsmlBuilder |
appendRandomSpeechOf(java.lang.String... text) |
SsmlBuilder |
appendSayAs(InterpretAs interpretAs,
java.lang.String text)
This will add the
enum InterpretAs to a given string. |
SsmlBuilder |
appendSlowText(java.lang.String text)
This will add the tag https//www.w3.org/TR/speech-synthesis11/#S3.2.3 to the
given string.
|
SsmlBuilder |
appendSpeech(java.lang.String text) |
SsmlBuilder |
appendSubAlias(java.lang.String text,
java.lang.String alias)
This will add a https//www.w3.org/TR/speech-synthesis11/#S3.1.11 tag with the given
text and alias.
|
SsmlBuilder |
appendText(java.lang.String text)
This will add more text to the
class SsmlBuilder |
SsmlBuilder |
appendText(SsmlBuilder text)
This will add an other
class SsmlBuilder to this one. |
java.lang.String |
asDisplayText()
Returns the containing string without any SSML tags.
|
java.lang.String |
asSsmlString()
Returns the containing string with a start and end tag.
|
SsmlBuilder |
plus(java.lang.String text)
This will add more text to the
class SsmlBuilder |
SsmlBuilder |
plus(SsmlBuilder text)
This will add an other
class SsmlBuilder to this one. |
java.lang.String |
toString()
Returns the containing string.
|
public static SsmlBuilder.Companion Companion
public SsmlBuilder(@NotNull
java.lang.String text)
Helper class for construction of SSML https//www.w3.org/TR/speech-synthesis11/ based responses. This Helper only contain the supported SSML tags for Amazon Alexa and the Google Assistant.
public SsmlBuilder()
Helper class for construction of SSML https//www.w3.org/TR/speech-synthesis11/ based responses. This Helper only contain the supported SSML tags for Amazon Alexa and the Google Assistant.
@NotNull public SsmlBuilder appendBreak(@Nullable Strength strength, @Nullable java.lang.Integer timeInMs)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.2.3 tag to the SSML string.
You can either choose to set a enum Strength, a time in milliseconds or the default for the break.
@NotNull public SsmlBuilder appendSlowText(@NotNull java.lang.String text)
This will add the tag https//www.w3.org/TR/speech-synthesis11/#S3.2.3 to the given string.
@NotNull public SsmlBuilder appendAudio(@NotNull java.lang.String url)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.3.1 tag with the given URL.
@NotNull public SsmlBuilder appendSayAs(@NotNull InterpretAs interpretAs, @NotNull java.lang.String text)
This will add the enum InterpretAs to a given string.
@NotNull public SsmlBuilder appendEmphasis(@NotNull Emphasis emphasis, @NotNull java.lang.String text)
This will add the https//www.w3.org/TR/speech-synthesis11/#S3.2.2 tag with the attribute
enum Emphasis to a given string.
@NotNull public SsmlBuilder appendAmazonEffect(@NotNull java.lang.String text, @NotNull AmazonEffect amazonEffect)
This will add the <> https//developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html#amazon-effect
tag with the enum AmazonEffect to a given string.
@NotNull public SsmlBuilder appendAlexaSpeechcon(@NotNull java.lang.String speechcon)
This will add a
@NotNull public SsmlBuilder appendAlexaSpeechconRandom(@NotNull java.lang.String... speechcons)
This will add a
@NotNull public SsmlBuilder appendText(@NotNull java.lang.String text)
This will add more text to the class SsmlBuilder
class SsmlBuilder@NotNull public SsmlBuilder appendText(@NotNull SsmlBuilder text)
This will add an other class SsmlBuilder to this one.
class SsmlBuilder@NotNull public SsmlBuilder plus(@NotNull java.lang.String text)
This will add more text to the class SsmlBuilder
class SsmlBuilder@NotNull public SsmlBuilder plus(@NotNull SsmlBuilder text)
This will add an other class SsmlBuilder to this one.
class SsmlBuilder@NotNull public SsmlBuilder appendRandomOf(@NotNull java.lang.String... text)
This will randomly append one of the given strings to this class SsmlBuilder
class SsmlBuilder@NotNull public SsmlBuilder appendSubAlias(@NotNull java.lang.String text, @NotNull java.lang.String alias)
This will add a https//www.w3.org/TR/speech-synthesis11/#S3.1.11 tag with the given text and alias.
@NotNull public SsmlBuilder appendSpeech(@NotNull java.lang.String text)
@NotNull public SsmlBuilder appendRandomSpeechOf(@NotNull java.lang.String... text)
@NotNull public java.lang.String asDisplayText()
Returns the containing string without any SSML tags.
@NotNull public java.lang.String toString()
Returns the containing string.
@NotNull public java.lang.String asSsmlString()
Returns the containing string with a start and end tag.