MsEdgeTTS
MsEdgeTTS copied to clipboard
Connect Error: [object Object]
import { MsEdgeTTS, OUTPUT_FORMAT } from "msedge-tts";
(async () => {
try {
const tts = new MsEdgeTTS();
await tts.setMetadata("en-US-AriaNeural", OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS).catch(e => {
console.log("An error occurred:");
console.error(e);
});
const filePath = await tts.toFile("./example_audio.webm", "Hi, how are you?");
} catch (error) {
console.log("An error catch:");
console.error(error);
}
})();
An error occurred: Connect Error: [object Object] An error catch: No audio data received node:internal/process/promises:389
maybe need to change default agent? I see the err have occurred only Chinese mainland areas, other similar repos have also appeared, , edge-tts 最近才出现的,国内使用会出现ws连接失败。看到其他类似库里有提相同的错误,并已经有修复的;可以尝试改默认代理设置修复一下。