Hi i’m new to the Twilio api.
Can any one provide some ideas or good example for converting text to speech(voice).
I’m using java & Rest api & Twilio api.
Hi i’m new to the Twilio api.
Can any one provide some ideas or good example for converting text to speech(voice).
I’m using java & Rest api & Twilio api.
2
Answers
enter code here
When application initiates a call to the Twilio API, for example via the CallFactory.create method, Twilio will send your request to a URL that is expected to return a TwiML response.The Say verb converts text to speech that is read back to the caller. is useful for development or saying dynamic text that is difficult to pre-record.
Another option for responding with TwiML is via the TwiMLResponse class, which is available in the com.twilio.sdk.verbs package.
reference linK : http://azure.microsoft.com/en-in/documentation/articles/partner-twilio-java-how-to-use-voice-sms/#howto_provide_twiml_responses
sample code to generating the TWIML using TwiMLResponse class using inputMsgString :
TwiMLResponse twiml = new TwiMLResponse(); Say say = new Say( inputMsgString); twiml.append(say); msgAsXML = twiml.toXML();
Twilio evangelist here.
The
<Say>
TwiML verb does this for you:I’d suggest working through the Voice Quickstart. It walks you through using Java to build a servlet that generates and returns TwiML:
https://www.twilio.com/docs/quickstart/java/twiml/say-response
Hope that helps.