MsEdgeTTS icon indicating copy to clipboard operation
MsEdgeTTS copied to clipboard

Connect Error: [object Object]

Open qingfengmy opened this issue 1 year ago • 1 comments

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

qingfengmy avatar Oct 30 '24 09:10 qingfengmy

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连接失败。看到其他类似库里有提相同的错误,并已经有修复的;可以尝试改默认代理设置修复一下。

aoaoms avatar Oct 31 '24 01:10 aoaoms