Answer the question
In order to leave comments, you need to log in
How to get mp3 file from SpeechKit Cloud response?
To not re-apply.
Is there a way to do this on the php server?
Answer the question
In order to leave comments, you need to log in
<?php
$id=$_GET["q"];
$say_text=$id;
$qs = http_build_query(array("format" => "mp3","lang" => "ru-RU","speaker" => "jane","key" => "ключ","emotion" => "good", "text" => $say_text)); // параметры запроса
$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 файла
file_put_contents('1.mp3',$soundfile); //сохраняю
echo($soundfile);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question