GetTTSInULAW
Use this method to convert text into a sound file encoded in u-Law format. Requires additional License Key. Call 1-800-984-3710 or log in at www.esendex.us to activate the TTS License Key. This key allows you to use the direct download TTS from webservices like Notify. This only allows for TTS to Sound Files. Phone Notify allows use of TTS in the notification call without this key.
Syntax
GetTTSInULAW(TextToSay, VoiceID, TTSrate, TTSvolume, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
TextToSay |
The text-to-speech text or combination of text-to-speech and script to be read to the receiving party. |
String
|
Hello, this is a sample call from Phone Notify. | |
VoiceID |
The text-to-speech voice ID. |
Integer
|
2 | |
TTSrate |
The speed that text-to-speech (TTS) will use when speaking the text. The value ranges from 0 to 20 (10 being normal). This can also be controlled within the |
UnsignedByte
|
7 | |
TTSvolume |
The volume that text-to-speech (TTS) will use when speaking the text. The value ranges from 0 to 100 (100 is the default). This can also be controlled within the |
UnsignedByte
|
90 | |
LicenseKey |
Your license key, which is required to invoke this web service. |
String
|
F01d89fd-5155-5455-5585-e84ab8de8591 |
Response
Returns: Base64Binary
Description: The result of the text-to-speech file request in ULAW format.
Code Samples
/* https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl was added as a Web Reference and given the name WSDL */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GetTTSInULAW.WSDL;
namespace GetTTSInULAW
{
class Program
{
static void Main(string[] args)
{
WSDL.PhoneNotify PN = new WSDL.PhoneNotify();
WSDL.NotifyReturn NR = new WSDL.NotifyReturn();
byte[] ULAW = PN.GetTTSInULAW("Hello this phone notify TTS to ULAW test.", 2, 6, 2, "YOUR LICENSE KEY");
System.IO.FileStream FS = new System.IO.FileStream(@"C:\Users\Desktop\TTS-ULAW.ulaw", System.IO.FileMode.Create, System.IO.FileAccess.Write);
FS.Write(ULAW, 0, ULAW.Length);
FS.Close();
Console.WriteLine("File saved to: " + @"C:\Users\Desktop\TTS-ULAW.ulaw");
Console.ReadLine();
}
}
}
' https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl was added as a Web Reference and given the name WSDL
Imports GetTTSInULAW.WSDL
Module Module1
Sub Main()
Dim PN As New WSDL.PhoneNotify
Dim NR As New WSDL.NotifyReturn
Dim ULAW As Array
Dim FS As System.IO.FileStream
ULAW = PN.GetTTSInULAW("Hello this phone notify TTS to ULAW test.", 2, 6, 2, "YOUR LICENSE KEY")
FS = New System.IO.FileStream("C:\Users\Desktop\TTS-ULAW.ulaw", System.IO.FileMode.Create, System.IO.FileAccess.Write)
FS.Write(ULAW, 0, ULAW.Length)
FS.Close()
Console.WriteLine("File saved to: " & "C:\Users\Desktop\TTS-ULAW.ulaw")
Console.ReadLine()
End Sub
End Module
GET /NotifyWS/PhoneNotify.asmx/GetTTSInULAW?TextToSay=string&VoiceID=string&TTSrate=string&TTSvolume=string&LicenseKey=string HTTP/1.1
Host: ws.esendex.us
POST /NotifyWS/PhoneNotify.asmx/GetTTSInULAW HTTP/1.1
Host: ws.esendex.us
Content-Type: application/x-www-form-urlencoded
Content-Length: length
TextToSay=string&VoiceID=string&TTSrate=string&TTSvolume=string&LicenseKey=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="http://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ws.esendex.us/NotifyWS/GetTTSInULAW"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTTSInULAW xmlns="http://ws.esendex.us/NotifyWS/">
<TextToSay>string</TextToSay>
<VoiceID>int</VoiceID>
<TTSrate>unsignedByte</TTSrate>
<TTSvolume>unsignedByte</TTSvolume>
<LicenseKey>string</LicenseKey>
</GetTTSInULAW>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTTSInULAWResponse xmlns="http://ws.esendex.us/NotifyWS/">
<GetTTSInULAWResult>base64Binary</GetTTSInULAWResult>
</GetTTSInULAWResponse>
</soap:Body>
</soap:Envelope>
POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetTTSInULAW xmlns="http://ws.esendex.us/NotifyWS/">
<TextToSay>string</TextToSay>
<VoiceID>int</VoiceID>
<TTSrate>unsignedByte</TTSrate>
<TTSvolume>unsignedByte</TTSvolume>
<LicenseKey>string</LicenseKey>
</GetTTSInULAW>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetTTSInULAWResponse xmlns="http://ws.esendex.us/NotifyWS/">
<GetTTSInULAWResult>base64Binary</GetTTSInULAWResult>
</GetTTSInULAWResponse>
</soap12:Body>
</soap12:Envelope>