Here is the code
<? $dir = scandir("str/"); $cd = count($dir); for($i = 2; $i < $cd; $i++){ $str = file_get_contents("str/".$dir[$i]); #echo file_get_contents("str/".$dir[$i]); #echo "https://tts.voicetech.yandex.net/generate?format=mp3&lang=ru-RU&speaker=jane&key=1f13aeaa-2cfc-4a5c-a79c-e14748345975&emotion=good&text=".$str."</br>"; $qs = http_build_query(array("format" => "mp3","lang" => "ru-RU","speaker" => "jane","key" => "1f13aeaa-2cfc-4a5c-a79c-e14748345975","emotion" => "good", "text" => $str)); // параметры запроса $ctx = stream_context_create(array("http"=>array("method"=>"GET","header"=>"Referer: \r\n"))); #$soundfile = file_get_contents("https://tts.voicetech.yandex.net/generate?".$qs, false, $ctx); // запрос на генерацию mp3 файла echo "https://tts.voicetech.yandex.net/generate?".$qs."</br>"; #file_put_contents("text/".$i.".mp3", $soundfile); if($i == 11){ break; } } ?> At the output: https://tts.voicetech.yandex.net/generate?format=mp3&lang=ru-RU&speaker=jane&key=1f13aeaa-2cfc-4a5c-a79c-e14748345975&emotion=good&text=%CA%EE%ED%E5%F6+%D1%EB%E5%EF%EE%E3%EE - one of the lines of output
Yandex SpechKit does not understand and gives the void. How to correct that there was a text instead of %CA%EE%ED%E5%F6+%D1%EB%E5%EF%EE%E3%EE ?