Pronunciation Dictionary

Pronunciation dictionary is an engine for enhancing the pronunciation of troublesome words. For example, ensuring the city name 'Reading' is pronounced correctly. Dictionaries are split into languages and types. For example, the town 'Reading' would be of type: location with language: en-gb and would belong, in this case, to the uk_towns dictionary.

Pronunciation dictionary ensures that all annotated words will be pronounced according to the language of the chosen speaker.
For example, the name 'Anne' has a different pronunciation depending on whether the speaker is Spanish or English.

To use this feature, words in the script should be marked up with the <!'type'> flag, whereby type is the type of dictionary to use. The dictionary flag that precedes the word should contain the type, and the one following should be empty <!>.

Available types currently: brand, location, name.
Available dictionaries (as of 17.03.22):
German: ‘de_boy_names’, ‘de_girl_names’, ‘de_last_names’, ‘de_brands’,
British English: ‘uk_boy_names’, ‘uk_girl_names’, ‘uk_last_names’, ’uk_cities’, ’ ‘uk_towns’, ‘uk_brands’,
American English: ‘us_boy_names’, ‘us_girl_names’, : ‘us_last_names’, ‘us_brands’, ‘us_cities’,

👍

For the latest list of types available:

types = apiaudio.Lexi.list_types()

📘

For Full Documentation on pronunciation dictionary Refer to:

PythonSDK
Full Reference

Lets go through an example:

STEP 1
Let's create a script that includes these problematic words. In the example below, we want the second occurrence of the word 'Reading' to be pronounced as the city name.

scriptText = "Hello I am reading a book on the city of <!location>Reading<!> today"
apiaudio.Script.create(
  			scriptId=”ad”, 
  			scriptText=scriptText)

STEP 2
To verify the effect of applying Pronunciation dictionary, you can preview your script to make sure your chosen words are going through the verification system. You also need to define the language parameter.

preview = apiaudio.Script.preview(scriptId="ad", language="en-gb")
print(preview)

Example Response:
In this case the town Reading is available in the British English dictionary. Pronunciation dictionary ensures that all words between [<!>....<!>] will be pronounced correctly.

Script Text Preview: Hello I am reading a book on the city of [<!>Reading<!>] today

STEP 3
Lastly, we are ready to create speech and master our audio with a sound template of our choice.
Remember, that Pronunciation dictionary derives the appropriate pronunciation from the language and accent of the voice. In this case we are using a British English voice Sonia. Therefore, Pronunciation dictionary ensures that words in your script will be pronounced correctly in British English. Supply useDictionary=true to the speech create call.

A full list of all our voices

❗️

Voice Provider "Msnr" Voices are not yet supported

#create speech 

speech = apiaudio.Speech.create(
  				 scriptId="ad",
           voice="sonia",
           useDictionary=True
)

#master the audio 

apiaudio.Mastering.create(
        scriptId=scriptId,
        soundTemplate="sundaymorning",
)

End to End Example

import apiaudio
apiaudio.api_key ="YOUR_KEY"

#create script with problematic words annotated with the appropriate type
scriptText = "Hello I am reading a book in the city of <!location>reading<!> today"
apiaudio.Script.create(
  			scriptId="ad", 
  			scriptText=scriptText) 

#preview script

preview = apiaudio.Script.preview(scriptId="ad", language="en-gb")
print(preview)

#create speech 

speech = apiaudio.Speech.create(
  				 scriptId="ad",
           voice="sonia",
           useDictionary=True
)

#master the audio 

mastering = apiaudio.Mastering.create(
        scriptId="ad",
        soundTemplate="sundaymorning",
)

print(mastering)

Coming Soon!

  • Certified Dictionary Content Lists - produce audio for the full list of items in any of the dictionaries
  • Local Dictionaries: Maintain a dictionary of your own words within API.audio infrastructure
  • More dictionaries of different types and languages