Changing voice per call
# support
b
If i was running a webhook trigger to call a user based on clicking a button - could i edit the voice at random (if i wanted to rotate let's say between 10 voices)?
v
@beta1 Absolutely! You can rotate between different voices by randomizing the selection of the voice parameter each time the webhook trigger is called. If you're using VAPI, you would typically set the voice parameter before making the API call to initiate the voice message. To implement this, you would need to have a list of the 10 voice names you want to rotate through and write logic in your webhook handler to select a voice at random each time the button is clicked. Then, you would set the chosen voice in the API call to VAPI. If you need assistance with the code to randomize the voice selection or with setting up the webhook, please let me know, and I can help guide you through the process.
You can continue this conversation by mentioning me in the message.
b
yes give me the code to do this
s
@beta1 You cannot rotate voices during a call randomly or even periodically. Instead, you can use squads to switch between different assistants.