Good day. Please tell me the next request
$file = '/var/www/trysome/speach-service/Italian.mp3'; $uuid = '3be1f9ddf4944a529be45f7ca471868b'; $key = '3d79c4f5-dec0-43b2-8ea4-2790696c5722'; $url = "http://asr.yandex.net/asr_xml?uuid=".$uuid."&topic=general&key=".$key; $curlConfig = array( CURLOPT_UPLOAD => true, CURLOPT_POST => true, CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, // CURLOPT_BINARYTRANSFER => true, CURLOPT_POSTFIELDS, array('audio' => $file), CURLOPT_VERBOSE => true, ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-type: audio/x-mpeg-3', 'Transfer-Encoding: chunked' )); curl_setopt_array($ch, $curlConfig); $result = curl_exec($ch); print var_dump($result);
in response comes
igor@igor-H81M-S2V:/var/www/trysome/speach-service$ php -f indexroot.php * Hostname was NOT found in DNS cache * Trying 213.180.193.202... * Connected to asr.yandex.net (213.180.193.202) port 80 (#0) > PUT /asr_xml?uuid=3be1f9ddf49b44529be45f7ca471868b&topic=general&key=3d79c3f5-dec0-43b2-8ea4-2790696c5722 HTTP/1.1 Host: asr.yandex.net Accept: */* Content-type: audio/x-mpeg-3 Transfer-Encoding: chunked Expect: 100-continue < HTTP/1.1 100 Continue < Access-Control-Allow-Origin: * < Connection: close < Content-Length: 0 < Content-Type: text/html < Date: Thu, 30 Jul 2015 10:43:52 MSK * Server YaVoiceProxy2 is not blacklisted < Server: YaVoiceProxy2 < X-YaReqFinish: 1438242232.212900 < X-YaRequestId: b90423dc-368e-11e4-a9e2-9277ca05b739 * HTTP 1.0, assume close after body < HTTP/1.0 400 Bad Request < Access-Control-Allow-Origin: * < Connection: close < Content-Length: 45 < Content-Type: text/html < Date: Thu, 30 Jul 2015 10:43:52 MSK * Server YaVoiceProxy2 is not blacklisted < Server: YaVoiceProxy2 < X-YaReqFinish: 1438242232.238032 < X-YaRequestId: b90423dc-368e-11e5-a9e2-9277ca05b739 < * Closing connection 0 string(45) "Streaming clients must specify audio field! "
The title indicates that the answer came 400
, and Streaming clients must specify audio field!
. This is not a valid request or by the specified parameters can not work the server? Can I somehow check if the audio track is being sent?
Thank.