0

My use case requires me to have users pick their desired voice for the autopilot questions. The thing is there doesn't seem to be a way of Dynamically choosing the Stylesheet of the Assistant (without actually updating the resource).

My perfect scenario would be something like: connect.autopilot(SID, {voice: 'Polly.Joanna'})

I've also checked in The JSON Encoded Actions Schema but it doesn't seem to have a way of changing the voice of a specific Autopilot Action like this:

"say": {
         "say_voice": "Polly.Joanna",
         "speech: "Example speech"
       }

The only reasonable solutions so far seem to be either:

  • create an Assistant for each user. (May lead to overloading Twilio)
  • have only one Assistant but update its stylesheet before connecting the user (This would probably lead to concurrency issues, right?)

Any other suggestions on how to tackle this problem? Thanks in advance

1 Answers1

0

You are right, an Assistant has one directly linked StyleSheet and that is how you define the voice. You also don't want to update the Assistant with a new StyleSheet as that would likely change the voice of any calls that are already in progress (though I haven't tested this).

You do suggest creating an Assistant for each user. According to the Autopilot documentation you can create up to 500 Assistants per account. I don't know how many users you have that need Assistants, but that could work? I would guess that if your users want to customise the voice, they may end up wanting to customise other aspects of the Assistant, including the phrases it uses, so it might be useful to have an Assistant each too.

I don't have any other ideas for this though, I'm afraid.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • 1
    Hey, thanks for the prompt response! I guess I was right and may have to try to work around this limitation. Love your work BTW, it's really helpful for the community! – Joaquín Zapata Jul 22 '22 at 13:42