Control how AI voices pronounce specific words using SSML phoneme tags in Pictory
This guide explains how to customize word pronunciation in your video voice-overs using SSML (Speech Synthesis Markup Language) phoneme tags. Phoneme tags give you precise control over how AI voices pronounce brand names, technical terms, foreign words, or any text that might be mispronounced.
Model Configuration: When using phoneme tags with ElevenLabs, you must specify a modelId in premiumVoiceSettings. If not provided, eleven_flash_v2 is used by default for phoneme processing.
Limited Model Support: Only three ElevenLabs models support phoneme tags. Other models will ignore phoneme markup.
English Only: Phoneme pronunciation control works only with English language content in ElevenLabs.
CMU Arpabet: ElevenLabs uses the CMU Arpabet phonetic alphabet.
Only the following three models support SSML phoneme tags in ElevenLabs. Using phoneme tags with other models will not produce the expected pronunciation changes.
Model ID
Description
Phoneme Support
eleven_flash_v2
Ultra-fast model (~75ms latency), English only (default for phonemes)
Yes
eleven_turbo_v2
High quality with low latency (~250-300ms), English only
import axios from "axios";const API_BASE_URL = "https://api.pictory.ai/pictoryapis";const API_KEY = "YOUR_API_KEY";async function createVideoWithPronunciation() { const storyWithPhonemes = ` Welcome to <phoneme alphabet="cmu-arpabet" ph="P IH1 K T AO0 R IY0">Pictory</phoneme>, the leading <phoneme alphabet="cmu-arpabet" ph="EY1 AY1">AI</phoneme> video creation platform. Our <phoneme alphabet="cmu-arpabet" ph="IH2 N T UW1 IH0 T IH0 V">intuitive</phoneme> interface transforms your text into professional videos using advanced <phoneme alphabet="cmu-arpabet" ph="AE1 L G AH0 R IH2 DH AH0 M Z">algorithms</phoneme>. Whether you are an <phoneme alphabet="cmu-arpabet" ph="AA2 N T R AH0 P R AH0 N ER1">entrepreneur</phoneme> or content creator, <phoneme alphabet="cmu-arpabet" ph="P IH1 K T AO0 R IY0">Pictory</phoneme> makes video production effortless. Watch our <phoneme alphabet="cmu-arpabet" ph="T UW0 T AO1 R IY0 AH0 L">tutorial</phoneme> to learn how <phoneme alphabet="cmu-arpabet" ph="EY1 AY1">AI</phoneme> <phoneme alphabet="cmu-arpabet" ph="V IH2 ZH UW0 AH0 L AH0 Z EY1 SH AH0 N">visualization</phoneme> can revolutionize your workflow. `; const response = await axios.post( `${API_BASE_URL}/v2/video/storyboard/render`, { videoName: "pictory_pronunciation_demo", // Voice-over with ElevenLabs premium voice voiceOver: { enabled: true, aiVoices: [ { speaker: "Brian", speed: 100, premiumVoiceSettings: { modelId: "eleven_flash_v2" // Required for phoneme support } } ] }, backgroundMusic: { enabled: true, volume: 0.1, autoMusic: true }, scenes: [ { story: storyWithPhonemes, isSSMLStory: true, createSceneOnEndOfSentence: true } ] }, { headers: { "Content-Type": "application/json", Authorization: API_KEY } } ); console.log("Job ID:", response.data.data.jobId); return response.data;}createVideoWithPronunciation();
import requestsAPI_BASE_URL = 'https://api.pictory.ai/pictoryapis'API_KEY = 'YOUR_API_KEY'def create_video_with_pronunciation(): story_with_phonemes = ''' Welcome to <phoneme alphabet="cmu-arpabet" ph="P IH1 K T AO0 R IY0">Pictory</phoneme>, the leading <phoneme alphabet="cmu-arpabet" ph="EY1 AY1">AI</phoneme> video creation platform. Our <phoneme alphabet="cmu-arpabet" ph="IH2 N T UW1 IH0 T IH0 V">intuitive</phoneme> interface transforms your text into professional videos using advanced <phoneme alphabet="cmu-arpabet" ph="AE1 L G AH0 R IH2 DH AH0 M Z">algorithms</phoneme>. Whether you are an <phoneme alphabet="cmu-arpabet" ph="AA2 N T R AH0 P R AH0 N ER1">entrepreneur</phoneme> or content creator, <phoneme alphabet="cmu-arpabet" ph="P IH1 K T AO0 R IY0">Pictory</phoneme> makes video production effortless. Watch our <phoneme alphabet="cmu-arpabet" ph="T UW0 T AO1 R IY0 AH0 L">tutorial</phoneme> to learn how <phoneme alphabet="cmu-arpabet" ph="EY1 AY1">AI</phoneme> <phoneme alphabet="cmu-arpabet" ph="V IH2 ZH UW0 AH0 L AH0 Z EY1 SH AH0 N">visualization</phoneme> can revolutionize your workflow. ''' response = requests.post( f'{API_BASE_URL}/v2/video/storyboard/render', json={ 'videoName': 'pictory_pronunciation_demo', # Voice-over with ElevenLabs premium voice 'voiceOver': { 'enabled': True, 'aiVoices': [ { 'speaker': 'Brian', 'speed': 100, 'premiumVoiceSettings': { 'modelId': 'eleven_flash_v2' # Required for phoneme support } } ] }, 'backgroundMusic': { 'enabled': True, 'volume': 0.1, 'autoMusic': True }, 'scenes': [ { 'story': story_with_phonemes, 'isSSMLStory': True, 'createSceneOnEndOfSentence': True } ] }, headers={ 'Content-Type': 'application/json', 'Authorization': API_KEY } ) print('Job ID:', response.json()['data']['jobId']) return response.json()create_video_with_pronunciation()
Problem: The phoneme tags appear as literal text in the voice-over.Solution: Ensure isSSMLStory: true is set in your scene configuration. This flag enables SSML processing.
Pronunciation sounds incorrect with ElevenLabs
Problem: The word is still mispronounced even with phoneme tags.Solution:
Verify you are using CMU Arpabet (not IPA) with ElevenLabs
Check that premiumVoiceSettings.modelId is specified
Ensure stress markers (0, 1, 2) are correctly placed
SSML not working with certain voices
Problem: Some voices do not process SSML tags correctly.Solution: Check the ssmlSupportCategory field from the Get Voiceover Tracks API. Some voices have limited SSML support.
Special characters causing errors
Problem: Request fails when using special characters in phoneme strings.Solution: Ensure proper escaping of special characters. In JSON, use \" for quotes within the phoneme attribute.