Slowing down Twilio text to voice playback in gather
I am attempting to use the SSMLProsody function to slow down the pace of playback for a persons name as well as a phone number. I have used the space and period method for showing down the pace but I would like more control. I see the SSMLProsody method has a "rate" that I would think would do the trick but I am not able to get it to work. If anyone can help me with this I would appreciate it. My code example:
var gather = new Gather(allowVoiceResponse ? new List<Gather.InputEnum>(new {Gather.InputEnum.Speech, Gather.InputEnum.Dtmf}) : new List<Gather.InputEnum>(new { Gather.InputEnum.Dtmf }),
numDigits: 1,
hints: "connect me, connect me now, connect",
timeout: CallLoopTimeout,
speechTimeout: "auto",
action: new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}ConnectVisitorCallback?{queryParams.GenerateQueryString()}"),
method: "POST");
if (lowSpeechConfidence)
{
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=3"));
}
else
{
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
var sayPhone = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedPhoneNumber, rate: "30%");
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=1"))
.Append(sayName)
.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=2"))
.Append(sayPhone);
}
twilio twilio-api
add a comment |
I am attempting to use the SSMLProsody function to slow down the pace of playback for a persons name as well as a phone number. I have used the space and period method for showing down the pace but I would like more control. I see the SSMLProsody method has a "rate" that I would think would do the trick but I am not able to get it to work. If anyone can help me with this I would appreciate it. My code example:
var gather = new Gather(allowVoiceResponse ? new List<Gather.InputEnum>(new {Gather.InputEnum.Speech, Gather.InputEnum.Dtmf}) : new List<Gather.InputEnum>(new { Gather.InputEnum.Dtmf }),
numDigits: 1,
hints: "connect me, connect me now, connect",
timeout: CallLoopTimeout,
speechTimeout: "auto",
action: new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}ConnectVisitorCallback?{queryParams.GenerateQueryString()}"),
method: "POST");
if (lowSpeechConfidence)
{
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=3"));
}
else
{
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
var sayPhone = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedPhoneNumber, rate: "30%");
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=1"))
.Append(sayName)
.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=2"))
.Append(sayPhone);
}
twilio twilio-api
add a comment |
I am attempting to use the SSMLProsody function to slow down the pace of playback for a persons name as well as a phone number. I have used the space and period method for showing down the pace but I would like more control. I see the SSMLProsody method has a "rate" that I would think would do the trick but I am not able to get it to work. If anyone can help me with this I would appreciate it. My code example:
var gather = new Gather(allowVoiceResponse ? new List<Gather.InputEnum>(new {Gather.InputEnum.Speech, Gather.InputEnum.Dtmf}) : new List<Gather.InputEnum>(new { Gather.InputEnum.Dtmf }),
numDigits: 1,
hints: "connect me, connect me now, connect",
timeout: CallLoopTimeout,
speechTimeout: "auto",
action: new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}ConnectVisitorCallback?{queryParams.GenerateQueryString()}"),
method: "POST");
if (lowSpeechConfidence)
{
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=3"));
}
else
{
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
var sayPhone = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedPhoneNumber, rate: "30%");
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=1"))
.Append(sayName)
.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=2"))
.Append(sayPhone);
}
twilio twilio-api
I am attempting to use the SSMLProsody function to slow down the pace of playback for a persons name as well as a phone number. I have used the space and period method for showing down the pace but I would like more control. I see the SSMLProsody method has a "rate" that I would think would do the trick but I am not able to get it to work. If anyone can help me with this I would appreciate it. My code example:
var gather = new Gather(allowVoiceResponse ? new List<Gather.InputEnum>(new {Gather.InputEnum.Speech, Gather.InputEnum.Dtmf}) : new List<Gather.InputEnum>(new { Gather.InputEnum.Dtmf }),
numDigits: 1,
hints: "connect me, connect me now, connect",
timeout: CallLoopTimeout,
speechTimeout: "auto",
action: new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}ConnectVisitorCallback?{queryParams.GenerateQueryString()}"),
method: "POST");
if (lowSpeechConfidence)
{
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=3"));
}
else
{
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
var sayPhone = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedPhoneNumber, rate: "30%");
gather.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=1"))
.Append(sayName)
.Play(new Uri($"{NotificationConfigurationManager.Configuration.TwilioVoiceApiAddress}GetSoundClip?siteId={siteId}&index=2"))
.Append(sayPhone);
}
twilio twilio-api
twilio twilio-api
asked Nov 20 at 18:21
James Wallace
186
186
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Twilio developer evangelist here.
The <Prosody>
and other SSML commands are only supported when you use Amazon's Polly voices.
So where you have:
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
You'll need something like
var sayName = new Say(voice: Say.VoiceEnum.PollyJoanna).SsmlProsody(queryParams.SpacedName, rate: "30%");
You can also set the default voice within your Twilio console.
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399192%2fslowing-down-twilio-text-to-voice-playback-in-gather%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Twilio developer evangelist here.
The <Prosody>
and other SSML commands are only supported when you use Amazon's Polly voices.
So where you have:
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
You'll need something like
var sayName = new Say(voice: Say.VoiceEnum.PollyJoanna).SsmlProsody(queryParams.SpacedName, rate: "30%");
You can also set the default voice within your Twilio console.
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
|
show 1 more comment
Twilio developer evangelist here.
The <Prosody>
and other SSML commands are only supported when you use Amazon's Polly voices.
So where you have:
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
You'll need something like
var sayName = new Say(voice: Say.VoiceEnum.PollyJoanna).SsmlProsody(queryParams.SpacedName, rate: "30%");
You can also set the default voice within your Twilio console.
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
|
show 1 more comment
Twilio developer evangelist here.
The <Prosody>
and other SSML commands are only supported when you use Amazon's Polly voices.
So where you have:
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
You'll need something like
var sayName = new Say(voice: Say.VoiceEnum.PollyJoanna).SsmlProsody(queryParams.SpacedName, rate: "30%");
You can also set the default voice within your Twilio console.
Twilio developer evangelist here.
The <Prosody>
and other SSML commands are only supported when you use Amazon's Polly voices.
So where you have:
var sayName = new Say(voice: Say.VoiceEnum.Man).SsmlProsody(queryParams.SpacedName, rate: "30%");
You'll need something like
var sayName = new Say(voice: Say.VoiceEnum.PollyJoanna).SsmlProsody(queryParams.SpacedName, rate: "30%");
You can also set the default voice within your Twilio console.
answered Nov 20 at 23:32
philnash
37k93353
37k93353
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
|
show 1 more comment
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Thank you for the response. What if we are not using Polly? Is there another way other than the periods and spaces to slow down the voice?
– James Wallace
Nov 21 at 19:37
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
Therre is not. The SSML functionality is for Polly voices only.
– philnash
Nov 21 at 23:01
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
philnash, can you tell me if I was to cut Polly on, on our account, will it continue to operate with the code as described above or will I have to have the SSML methods already in code when the cut over is made or will the older style api calls still work as they did?
– James Wallace
Nov 26 at 17:03
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Polly voices work with all existing TwiML. You can then enhance it with SSML when you're ready.
– philnash
Nov 26 at 20:01
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
Thank you for all of your help with this and answering my questions.
– James Wallace
Nov 27 at 14:31
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399192%2fslowing-down-twilio-text-to-voice-playback-in-gather%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown