Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于语音识别只出时间轴和翻译报错的解决方案 #187

Closed
ainy0315 opened this issue Dec 17, 2021 · 1 comment
Closed

关于语音识别只出时间轴和翻译报错的解决方案 #187

ainy0315 opened this issue Dec 17, 2021 · 1 comment

Comments

@ainy0315
Copy link

解决了,我用sstap挂了全局代理就好了 V2RAYN和clash都不能解决这个问题 我用终端命令也是这样 测试能访问谷歌,但是无法识别。翻译现在是报这种错误 autosub -S ja-jp -i "C:\Users\Administrator\Downloads\LANREN\LANREN.mp4" -D zh-cn 然后语音识别100%后报这个 语音转文字中: 100% |#########################################################################################| Time: 0:01:28 Traceback (most recent call last): File "C:\Python39\lib\runpy.py", line 197, in run_module_as_main return run_code(code, main_globals, None, File "C:\Python39\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Python39\Scripts\autosub.exe__main.py", line 7, in File "C:\Python39\lib\site-packages\autosub__init_.py", line 166, in main cmdline_utils.audio_or_video_prcs(args, File "C:\Python39\lib\site-packages\autosub\cmdline_utils.py", line 1614, in audio_or_video_prcs translated_text, args.src_language = core.list_to_googletrans( File "C:\Python39\lib\site-packages\autosub\core.py", line 772, in list_to_googletrans result_src = translator.detect(content_to_trans).lang File "C:\Python39\lib\site-packages\googletrans\client.py", line 369, in detect translated = self.translate(text, src='auto', dest='en') File "C:\Python39\lib\site-packages\googletrans\client.py", line 219, in translate parsed = json.loads(data[0][2]) File "C:\Python39\lib\json__init__.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not NoneType 还是跟以前提到的issues

Originally posted by @ainy0315 in #185 (comment)

翻译报错问题也解决了,目前可以确认的是最新DEV语音识别和googletrans都没有问题,导致上述问题出现有三个原因,一是没有使用正确的代理方式,二是缺少相应的python环境 三是autosub缺少参数
代理方式:我试过设置终端代理加本地VPN 终端代理+clash 终端代理+v2rayN,不知道是不是因为设置方式的问题,在通过curl www.google.com测试后,语音识别始终仍然只出时间轴,更别提翻译了
环境问题:为什么说环境问题呢 因为我在使用SubtitleTranslator(https://github.com/ainy0315/SubtitleTranslator)这个同样使用googletrans 4.0.0rc1的工具的时候发现这个程序能够正常运行,也就是说googletrans 4.0.0rc1能够正常运行。但是我之前使用googletrans明显会报上述错误,所以我赶紧打开autosub!!!发现竟然能够i正常使用了!!!!为什么会这样呢 ,我想应该是安装SubtitleTranslator时会先安装它的支持环境,而他的支持环境正好是googletrans能够正常运行的环境,所以只需要看看他的requirements然后安装环境就可以了
参数问题:在安装SubtitleTranslator发现googletrans能够正常使用后,我使用-S ja-jp -i "C:\Users\Administrator\Downloads\LANREN\LANREN.mp4" -D zh-cn在最后翻译的时候闪退,后来我又使用-S ja-jp -i "C:\Users\Administrator\Downloads\LANREN\LANREN.mp4" -SRC ja -D zh-cn 发现能够正常翻译了

Originally posted by @ainy0315 in #186 (comment)

@BingLingGroup
Copy link
Owner

不要重复发issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants