GetSoundFileInMP3
This method returns a sound file encoded as an MP3 in 32, 64, or 128 Kpbs.
Syntax
GetSoundFileInMP3(SoundFileID, BitRate, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
SoundFileID |
The sound file's ID. |
String
|
True | 4013529 |
BitRate |
The desired bitrate for the returned MP3 file. 128 is common for bandwidth reasons, while 192 and 256 are used for higher-quality, larger files. |
Integer
|
True | 128 |
LicenseKey |
Your license key, which is required to invoke this web service. |
String
|
True | F01d89fd-5155-5455-5585-e84ab8de8591 |
Response
Returns: Base64Binary
Description: The Base64 encoded file data.
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 GetSounFileInMP3.Properties;
using GetSounFileInMP3.WSDL;
namespace GetSounFileInMP3
{
class Program
{
static void Main(string[] args)
{
WSDL.PhoneNotify PN = new WSDL.PhoneNotify();
WSDL.NotifyReturn NR = new WSDL.NotifyReturn();
byte[] MP3 = PN.GetSoundFileInMP3("soundfilename_wav", 128, "YOUR LICENSE KEY");
System.IO.FileStream FS = new System.IO.FileStream(@"C:\Users\Desktop\soundfilename.mp3", System.IO.FileMode.Create, System.IO.FileAccess.Write);
FS.Write(MP3, 0, MP3.Length);
FS.Close();
Console.WriteLine("Sound file saved to: " + @"C:\Users\Desktop\soundfilename.mp3");
Console.ReadLine();
}
}
}
' https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl was added as a Web Reference and given the name WSDL
Imports GetSoundFileInMP3.WSDL
Module Module1
Sub Main()
Dim PN As New WSDL.PhoneNotify
Dim NR As New WSDL.NotifyReturn
Dim MP3 As Array
Dim FS As System.IO.FileStream
MP3 = PN.GetSoundFileInMP3("testsoundfile_wav", 128, "YOUR LICENSE KEY")
FS = New System.IO.FileStream("C:\Users\Desktop\testsoundfile.mp3", System.IO.FileMode.Create, System.IO.FileAccess.Write)
FS.Write(MP3, 0, MP3.Length)
FS.Close()
Console.WriteLine("File saved to: " & "C:\Users\Desktop\testsoundfile.mp3")
Console.ReadLine()
End Sub
End Module
GET /NotifyWS/PhoneNotify.asmx/GetSoundFileInMP3?SoundFileID=string&BitRate=string&LicenseKey=string HTTP/1.1
Host: ws.esendex.us
POST /NotifyWS/PhoneNotify.asmx/GetSoundFileInMP3 HTTP/1.1
Host: ws.esendex.us
Content-Type: application/x-www-form-urlencoded
Content-Length: length
SoundFileID=string&BitRate=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/GetSoundFileInMP3"
<?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>
<GetSoundFileInMP3 xmlns="http://ws.esendex.us/NotifyWS/">
<SoundFileID>string</SoundFileID>
<BitRate>int</BitRate>
<LicenseKey>string</LicenseKey>
</GetSoundFileInMP3>
</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>
<GetSoundFileInMP3Response xmlns="http://ws.esendex.us/NotifyWS/">
<GetSoundFileInMP3Result>base64Binary</GetSoundFileInMP3Result>
</GetSoundFileInMP3Response>
</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>
<GetSoundFileInMP3 xmlns="http://ws.esendex.us/NotifyWS/">
<SoundFileID>string</SoundFileID>
<BitRate>int</BitRate>
<LicenseKey>string</LicenseKey>
</GetSoundFileInMP3>
</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>
<GetSoundFileInMP3Response xmlns="http://ws.esendex.us/NotifyWS/">
<GetSoundFileInMP3Result>base64Binary</GetSoundFileInMP3Result>
</GetSoundFileInMP3Response>
</soap12:Body>
</soap12:Envelope>