Closed BogdanMaier closed 1 year ago
having the same issue as well. 😕 I did a work around using this code from this resource. Hope it helps!
import https from "https";
....
const options = {
method: "POST",
hostname: "api.deepgram.com",
port: null,
path: "/v1/listen",
headers: {
"content-type": "application/json",
Authorization: `Token ${process.env.DG_KEY}`
}
};
const request = https.request(options, response => {
const chunks = [];
response.on("data", function (chunk) {
chunks.push(chunk);
});
response.on("end", function () {
const body = Buffer.concat(chunks);
const r = JSON.parse(body.toString());
if (r.results && r.results.channels && r.results.channels.length) {
const transcript = r.results.channels[0].alternatives.map(alt => alt.transcript);
res.status(200).json({ transcript, success: true });
}
});
response.on("error", (e) => {
throw e;
});
});
...
Thanks for reporting @BogdanMaier and for confirming @m1ggy. PR #96 is incoming to fix the issue.
I am trying to submit the demo video for transcription
Steps to reproduce
Expected behavior
Please tell us about your environment
Other information