-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adding more natural sounding voices to phone calls #2575
feat: Adding more natural sounding voices to phone calls #2575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to look into using the XML encoder to deal with the escaping issue (as a separate PR), I already started some of that with the mocktwilio refactor work, so I think it will be straightforward.
@mastercactapus Cool. I'll wait until your XML PR #2582 goes in before making more updates to this PR. |
@AlaricWhitney the XML PR has been merged |
Co-authored-by: Nathaniel Caza <[email protected]>
Co-authored-by: Nathaniel Caza <[email protected]>
This pull request has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
@AlaricWhitney, just a note on this, I haven't had a chance to dig in, but it doesn't seem to work with the Polly voices. The |
@mastercactapus This is ready for review again. I've implemented the message to include an extra optional query parameter that indicates where in the string slice to insert pauses. I've also added unit tests and benchmark tests to show how it works. I also moved some of the message functionality into their own separate functions to make unit testing easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to manage/track indexes all over the place is going to be error-prone and noisy; we should be using a slice of strings throughout our application code to manage chunks of text.
The request itself can have the slice encoded in a string
+ []int
format, but we should parse that as soon as we get the request into a more usable format of []string
, and only switch to indexes at the last moment when we build the URL.
Doing so will let us simplify a lot of this.
notification/twilio/voice.go
Outdated
switch call.Digits { | ||
default: | ||
resp.SayUnknownDigit() | ||
fallthrough | ||
case "", digitRepeat: | ||
resp.Say(call.msgBody) | ||
processSayBody(resp, call.msgBody, call.msgPauseIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should just be a method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do it if you want, although I do think since it's voice specific, so I will make it part of the Voice object.
I chose to do it this way to ensure separation of functionality between what each object is supposed to do, and ensure backwards compatibility. More specifically, I really think that the message injection processing should occur immediately next to where the message is defined. Indexes are ordered, so it shouldn't be an issue to pass it around a little bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing this now and not running into that @tony-tvu 🤔 Was this right after running |
@tony-tvu I'm seeing that as well. When I looked it up, it's a git thing. Not sure if it's local to my computer or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to functionally test this with a real phone call and change the voices. Hopefully the issue with build | fatal: No names found, cannot describe anything
logs resolves itself when running on GoAlert's repo.
make check
to catch common errors. Fixed any that came up.Description:
This PR updates the application to have be able to set the Twilio Phone call language and Text To Speech engine.
us-EN
). This PR allows you to adjust it to whatever you need.Which issue(s) this PR fixes:
Fixes #2574
Fixes #2576
Out of Scope:
NA
Screenshots:
NA
Describe any introduced user-facing changes:
By default, nothing changes for the user, however the user does have the new ability to change the TTS voice engine and the language for phone calls.
Describe any introduced API changes:
NA
Additional Info:
NA