Migushthe2nd / MsEdgeTTS

A simple Azure Speech Service module that uses the Microsoft Edge Read Aloud API
https://migushthe2nd.github.io/MsEdgeTTS/
MIT License
289 stars 41 forks source link

Connect Error: [object Object] #20

Open qingfengmy opened 3 weeks ago

qingfengmy commented 3 weeks ago
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

aoaoms commented 3 weeks ago

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