Answer the question
In order to leave comments, you need to log in
SpeechKit API in JS?
I record from a microphone in .ogg
format
. The function returns me a link to a file like " blob: https://xn--80aaj5aiiy2b.xn--p1ai/ce8b1088-7f67-45... "
Then I have to transfer via API to Yandex SpeechKit , only it is not possible to transfer
Here is the function itself
function SpeechKit(link) {
console.log(link);
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://stt.api.cloud.yandex.net/speech/v1/stt:recognize",true);
xhr.setRequestHeader("Authorization", "Api-Key ........");
xhr.setRequestHeader("Content-Type", "text/plain");
xhr.setRequestHeader("Accept", "/");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Postman-Token", "9d5bfa....");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question