Speech Synthesis Markup Language (SSML) in the Storyteller WordPress plugin

The Storyteller plugin supports Speech Synthesis Markup Language(SSML). Using SSML-enhanced text gives you additional control over how ElevenLabs generates speech from the text you provide.

You can fine-tune for the following entities:

SSML is possible by using shortcodes inside the WordPress page. A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line.

Multiple voices (SSML in Storyteller)

You can use multiple voices on one page. And also you can voice different fragments of the page in different languages. Use the [storyteller-voice] shortcode to speak the text with the specified voice. Each listed voice has its own individual character. The [storyteller-voice] shortcode can be used in combination with all other SSML shortcodes.

NOTES

Make sure that there are no spaces between characters in the voice name.

You can find out the name of the voice that you need in the settings:

Example of using shortcode below

[storyteller-voice id=“XB0fDUnXU5powFXDhCwa”]Hello![/storyteller-voice]

You can find the list of all available voices for you on the Elevenlabs dashboard.

Pause

To add a pause to your text, use the [storyteller-break] shortcode. This will create an exact and natural pause in the speech. It is not just added silence between words, but the AI has an actual understanding of this syntax and will add a natural pause.

Give me one second to think about it. [storyteller-break time="2s"] Yes, that would work.

Mute

You can turn off the spoken part of the page. Wrap it in [storyteller-mute] shortcode to prevent this section of the page from being spoken.

[storyteller-mute] Text to be removed from the audio [/storyteller-mute] 

Pronunciation

This feature is currently only supported by the “Eleven English V1” and “Eleven Turbo V2” models.

In certain instances, you may want the model to pronounce a word, name, or phrase in a specific way. Pronunciation can be specified using standardised pronunciation alphabets. Currently the service supports the International Phonetic Alphabet (IPA) and the CMU Arpabet. Pronunciations are specified by wrapping words using the Speech Synthesis Markup Language (SSML) phoneme tag.

To use this feature, you need to wrap the desired word or phrase in the [storyteller-phoneme] wih using alphabet attribute.

An example for IPA:

<storyteller-phoneme alphabet="ipa" ph="ˈæktʃuəli">actually</storyteller-phoneme>

An example for CMU Arpabet:

<storyteller-phoneme alphabet="cmu-arpabet" ph="AE K CH UW AH L IY">actually</storyteller-phoneme>

It is important to note that this only works per word. Meaning that if you, for example, have a name with a first and last name that you want to be pronounced a certain way, you will have to create the pronunciation for each word individually.

English is a lexical stress language, which means that within multi-syllable words, some syllables are emphasized more than others. The relative salience of each syllable is crucial for proper pronunciation and meaning distinctions. So, it is very important to remember to include the lexical stress when writing both IPA and ARPAbet as otherwise, the outcome might not be optimal.

Take the word “talon”, for example.

Incorrect:

<storyteller-phoneme alphabet="cmu-arpabet" ph="T AE L AH N">talon</storyteller-phoneme>

Correct:

<storyteller-phoneme alphabet="cmu-arpabet" ph="T AE1 L AH0 N">talon</storyteller-phoneme>

The first example might switch between putting the primary emphasis on AE and AH, while the second example will always be pronounced reliably with the emphasis on AE and no stress on AH.

If you write it as:

<storyteller-phoneme alphabet="cmu-arpabet" ph="T AE0 L AH1 N">talon</storyteller-phoneme>

It will always put emphasis on AH instead of AE.

With the current implementation, we recommend using the CMU ARPAbet as it seems to be a bit more consistent and predictable with the current iteration of AI models. Some people get excellent results with IPA, but we have noticed that ARPAbet seems to work better with the current AI and be more consistent for a lot of users. However, we are working on improving this.

Audio file URL

Use the shortcode [toryteller-file] to display the audio record file URL of the current post/page.

Was this article helpful to you?