Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Created November 11, 2011 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwatson/1357106 to your computer and use it in GitHub Desktop.
Save andrewwatson/1357106 to your computer and use it in GitHub Desktop.
Example Nuance Integration
<?php
$headers = array(
"X-Language: en-US",
"X-Service: FullAuto",
"X-Reference: voicecloud-reference-123",
"Content-Type: audio/wav",
"Content-Transfer-Encoding: base64",
"Content-Length: " . filesize("test2.64.wav")
);
$ch = curl_init("https://eps-iot.nuancevm.com/conversions/voicecloud-us-voicemail");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, "@test2.64.wav");
$response = curl_exec($ch);
$info = curl_getinfo($ch);
echo curl_error($ch);
echo $response;
var_dump($info);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment