ich das von der IBM Watson Rede bekam Dokumente in Text, eine Audio-Datei zur Verarbeitung senden:Wie diese cURL in PHP übergeben?
curl -X POST -u <username>:<password>
--header "Content-Type: audio/flac"
--header "Transfer-Encoding: chunked"
--data-binary @<path>0001.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true"
Aber wie soll ich das in PHP cURL bauen? Etwas wie das?
$headr = array();
$headr[] = 'Content-Type: audio/flac';
$headr[] = 'Transfer-Encoding: chunked';
...
$crl = curl_init('https://stream.watsonplatform.net/speech-to-text/api');
curl_setopt($crl, CURLOPT_POST, 1);
curl_setopt($crl, CURLOPT_POSTFIELDS, array("username:password"=>"myuser:mypassword","data-binary"=>"@<path>0001.flac"));
curl_setopt($crl, CURLOPT_HTTPHEADER, $headr);
Was ist mit den -x und -u?