Open josephfeleke opened 1 year ago
This example worked:
import axios from "axios";
import fs from "fs";
const ENDPOINT = "https://tiktok-tts.weilnet.workers.dev";
const text = "hello baby";
const voice = "en_us_ghostface";
axios({
method: "post",
url: `${ENDPOINT}/api/generation`,
data: { text, voice },
headers: {
"Content-Type": "application/json",
},
})
.then((response) => {
const { data } = response.data;
const buffer = Buffer.from(data, "base64");
fs.writeFileSync("./audio.mp3", buffer);
})
.catch((error) => {
console.error(error);
});
I was trying to make a request to the api using nodejs express but it does not return anything and it times out my code: