I'm hitting the following error when passing SSML ...
# ask-ai
m
I'm hitting the following error when passing SSML through
tts_node
:
Copy code
ERROR livekit.plugins.resemble - Unexpected Resemble message {'success': False, 'error_name': 'InvalidSSML', 'error_params': {'ssml': '<speak>This part is normal. <prosody pitch="x-high">This part is going to sound high pitched</prosody>. <prosody rate="150%">This part is going to be spoken fast</prosody>. <prosody volume="loud">And this part is loud</prosody>!<speak>', 'reason': "Failed schema validation for reason: Element '{http://www.w3.org/2001/10/synthesis}speak': This element is not expected. (<string>, line 0)"}, 'message': 'SSML is not valid: "<speak>This part is normal. <prosody pitch="x-high">This part is going to sound high pitched</prosody>. <prosody rate="150%">This part is going to be spoken fast</prosody>. <prosody volume="loud">And this part is loud</prosody>!<speak>". Reason: Failed schema validation for reason: Element \'{http://www.w3.org/2001/10/synthesis}speak\': This element is not expected. (<string>, line 0)', 'status_code': 400, 'type': 'error'}
even though the text is coming from the docs:
Copy code
<speak>This part is normal. <prosody pitch="x-high">This part is going to sound high pitched</prosody>. <prosody rate="150%">This part is going to be spoken fast</prosody>. <prosody volume="loud">And this part is loud</prosody>!<speak>
t
Thanks for reaching out, Anas. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error you're seeing usually means there’s a hiccup with how the SSML is structured or the tags you’re using. Specifically, it looks like the <speak> tag popped up where it wasn’t expected. No worries though—here are some friendly tips to help you fix it: • Make sure your SSML content is wrapped in just one pair of
<speak>
tags. For example:
<speak>This part is normal. <prosody pitch="x-high">This part is going to sound high pitched</prosody>. <prosody rate="150%">This part is going to be spoken fast</prosody>. <prosody volume="loud">And this part is loud</prosody>!</speak>
• Double-check that you don’t have any
<speak>
tags nested inside each other, since that’s a no-go. • Take a peek at Resemble’s supported SSML tags and attributes to make sure everything lines up. You can find their docs right here. • Try starting simple with something like: `<speak>Hello world</speak>`Then slowly add more to see where things might be going sideways. If it’s still acting up, feel free to share the exact SSML you’re using and let me know whether you’re working with the REST API or WebSocket API for synthesis. I’m here to help you get this sorted! Sources: plugins/resemble/src/tts.test.ts | tests/test_tts.py | Resemble AI TTS integration guide | LiveKit Docs
m
I noticed that it happens when there's a
.
in the message. for example, this works fine:
Copy code
<speak><prosody rate="150%">Hello world</prosody></speak>
while this thrown an error:
Copy code
<speak><prosody rate="150%">Hi, this is Anas. Did I catch you at a good time for a quick chat?</prosody></speak>
the error shows that the text was truncated at the dot
t
It looks like the issue might be connected to how periods (or punctuation) are being handled in your SSML content. Resemble AI does support SSML, but there isn’t specific documentation about problems with periods. No worries though—here are a few steps you can try to troubleshoot and hopefully fix this: • Make sure your SSML content is properly formatted and wrapped inside a single pair of
<speak>
tags. • Try escaping the period or swapping it out for a different punctuation mark to see if that changes anything. • Test with simpler SSML content to narrow down the issue. For example: `<speak><prosody rate="150%">Hi, this is Anas</prosody></speak>`Then, slowly add more punctuation to pinpoint what might be causing the problem. If you’re still running into trouble, feel free to share the exact error message you see when the text gets cut off at the period. That’ll help us dig in and figure out what’s going on together! Sources: Text-to-speech (TTS) integrations | LiveKit Docs | Resemble AI TTS integration guide | LiveKit Docs