rany2 / edge-srt-to-speech

Convert SubRip to speech using Microsoft Edge's TTS service
https://pypi.org/project/edge-srt-to-speech/
GNU General Public License v3.0
43 stars 10 forks source link

How to solve the directory error problem #21

Open suifengtec opened 7 months ago

suifengtec commented 7 months ago

After run the command:

edge-srt-to-speech --voice zh-CN-XiaoxiaoNeural test.srt test.mp3

I got an error as follow:

` During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\Python\Python310\Scripts\edge-srt-to-speech.exe__main__.py", line 7, in File "D:\Python\Python310\lib\site-packages\edge_srt_to_speech__main.py", line 323, in main asyncio.get_event_loop().run_until_complete( File "D:\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "D:\Python\Python310\lib\site-packages\edge_srt_to_speech\main.py", line 190, in _main with tempfile.TemporaryDirectory() as temp_dir: File "D:\Python\Python310\lib\tempfile.py", line 869, in exit__ self.cleanup() File "D:\Python\Python310\lib\tempfile.py", line 873, in cleanup self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors) File "D:\Python\Python310\lib\tempfile.py", line 855, in _rmtree _shutil.rmtree(name, onerror=onerror) File "D:\Python\Python310\lib\shutil.py", line 750, in rmtree return _rmtree_unsafe(path, onerror) File "D:\Python\Python310\lib\shutil.py", line 620, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "D:\Python\Python310\lib\tempfile.py", line 846, in onerror cls._rmtree(path, ignore_errors=ignore_errors) File "D:\Python\Python310\lib\tempfile.py", line 855, in _rmtree _shutil.rmtree(name, onerror=onerror) File "D:\Python\Python310\lib\shutil.py", line 750, in rmtree return _rmtree_unsafe(path, onerror) File "D:\Python\Python310\lib\shutil.py", line 601, in _rmtree_unsafe onerror(os.scandir, path, sys.exc_info()) File "D:\Python\Python310\lib\shutil.py", line 598, in _rmtree_unsafe with os.scandir(path) as scandir_it: NotADirectoryError: [WinError 267] 目录名称无效。: 'C:\Users\suife\AppData\Local\Temp\tmpeph4xjnc\50.mp3' Generating audio: 94%|███████████████████████████████████████████████████████▌ | 80/85 [00:28<00:01, 2.83it/s] ` 7851

the command line tool show "目录名称无效", it means "Directory name is invalid", how to solve this problem?

Thank you!