sprintf("@%s", $file),); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); // Ready to send: $transcript = NULL; $result = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $code; switch($code) { case 200: echo $result; $result = json_decode($result, true); if ( array_key_exists("text" , $result )){ $transcript = $result["text"]; } else { throw new exception("Strange nexiwave Response. No text or result_callback field. " + $result); } break; default: throw new exception($result); } // Perform your magic here echo $transcript; ?>