-1

Let's say you have a sentence like "today, we are going to McDonald's for lunch". In Spanish it's roughly, "hoy vamos a almorzar a McDonald's".

Linguistics aside, my stakeholder (who's a Spanish native) is interested in having the proper noun (McDonald's) pronounced, by the Twilio Say verb, as a native English speaker would pronounce it.

What is the best way to do this?

Couple other details:

  • our Say prompts are dynamically driven and assembled by code
  • the proper noun is dynamic in our TwiML based, meaning there is 50+ words/phrases the proper noun(s) could be, and the options continue to grow.
  • I'm guessing that I could probably just "stack" (psuedo markup) it like below, but will that audibly flow well? Plus, I'm guessing that will result in two different "voices" being used.
  • Pre-recording the prompt(s) is not practical in our use case because of the varied, dynamic nature of the prompts.
  • Is there any other way to do this with a single verb?

Thanks!

(Psudeo TwiML)

    <say lang="ES">hoy vamos a almorzar a</say>
    <say lang="EN">McDonald's</say>
    <say lang="ES">[something in ES]</say>
Ted Krapf
  • 403
  • 3
  • 11
  • 1
    You are on the right track. Your pseudo should work. That is how I mix English with Spanish in an IVR app. There is also a ssml command "" to specify language for a segment within a phrase which would allow you use one Say verb. The same "voice" should sound the same whether in English or Spanish. Eventually, you are going to need to use ssml for accurate pronunciation whether it is speed, pauses, or spelling out acronyms. For example, you might need to make it say "mack donald's" for an accurate pronunciation. SSML is covered here: twilio.com/docs/voice/twiml/say/text-speech#ssml – jassent Jul 14 '23 at 20:54

1 Answers1

1

Here is how you would do this in one Say verb using ssml:

 <response>    
   <say>
    <lang="es-US">hoy vamos a almorzar a</lang>
    <lang="en-US">McDonalds</lang>
    <lang="es-US">[something in ES]</lang>
   </say>
 </response>

This page has the codes for the available languages.

jassent
  • 529
  • 3
  • 10
  • Thanks @jassent, I figured that the SSML was the proper way to go about it language mixing, but I wasn't entirely sure about the voice. Thank you for sharing your insight! – Ted Krapf Jul 17 '23 at 13:53