edge-tts icon indicating copy to clipboard operation
edge-tts copied to clipboard

sometimes program crash without error

Open iorilu opened this issue 5 months ago • 0 comments

hi , I used edge-tts for a while mostly it's working well

but sometimes it will crash , without any error

I made some simple scripts to use this library, when crash , the python process just quit , so it's hard to find the reason, anyone knows about this ?

here is the code snippet sine i use this in a sperate thread , so i get new event loop the raason I use new loop , is because I will it in pyqt , and pyqt has it's own event loop

  try:
      loop = asyncio.new_event_loop()
      asyncio.set_event_loop(loop) 
      # this function will call edge-tts api
      task = make_audio_txt(txt_path, voice_name, audio_path,
                                voice_speed, voice_volume, voice_pitch)
      asyncio.get_event_loop().run_until_complete(task)
      return audio_path
  except Exception as e:
      logger.debug(str(e))
  finally:
      loop.close()

iorilu avatar Jan 26 '24 01:01 iorilu