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

安装最新版dev和alpha只生成时间轴,无法正常进行语音转文字 #185

Closed
ainy0315 opened this issue Dec 15, 2021 · 3 comments

Comments

@ainy0315
Copy link

ainy0315 commented Dec 15, 2021

确保你已经看过 readme,也搜索并阅读过和你遇到的情况相关的问题。否则会被认为是重复的并被立刻关闭。

描述问题
使用pip install git 安装最新的dev和alpha使用谷歌语音识别只输出时间轴(包括使用源码安装),在设置代理后仍然出现(确保我的代理可以使用)。我以为是报loglevelerro的问题,但使用发布版能够正常识别。另外翻译错误是整个结束后直接报翻译错误,,没有任何提示。

复现问题
复现问题的步骤:

  • 你使用的命令行参数。推荐使用以下的代码块markdown语法,将代码块复制到```和```之间即可。
C:\Users\Administrator>autosub -S ja-jp -i "C:\Users\Administrator\Downloads\LANREN\LANREN.mp4"
翻译目的语言未提供。只进行语音识别。

将源文件转换为"C:\Users\ADMINI~1\AppData\Local\Temp\tmpdxfrrimb.wav"来检测语音区域。
C:\ProgramData\chocolatey\bin\ffmpeg.exe -hide_banner -y -i "C:\Users\Administrator\Downloads\LANREN\LANREN.mp4" -vn -ac 1 -ar 48000 -loglevel error "C:\Users\ADMINI~1\AppData\Local\Temp\tmpdxfrrimb.wav"

使用ffprobe来检查转换结果。
C:\ProgramData\chocolatey\bin\ffprobe.exe "C:\Users\ADMINI~1\AppData\Local\Temp\tmpdxfrrimb.wav" -show_format -pretty -loglevel quiet
[FORMAT]
filename=C:\Users\ADMINI~1\AppData\Local\Temp\tmpdxfrrimb.wav
nb_streams=1
nb_programs=0
format_name=wav
format_long_name=WAV / WAVE (Waveform Audio)
start_time=N/A
duration=0:08:57.425854
size=49.202925 Mibyte
bit_rate=768.001000 Kbit/s
probe_score=99
TAG:comment=vid:v03004f60000bv918f7ju3ksvje2dkn0
TAG:encoder=Lavf58.76.100
[/FORMAT]

转换完毕。
使用Auditok检测语音区域。
Auditok语音区域检测完毕。
"C:\Users\ADMINI~1\AppData\Local\Temp\tmpdxfrrimb.wav"已被删除。

按照语音区域将音频转换为多个短语音片段。
转换中:   0% |                                                                                            | ETA:  --:--转换中:   0% |                                                                                            | ETA:  --:--转换中:   7% |######                                                                                      | ETA:   0:00转换中:  25% |#######################                                                                     | ETA:   0:00转换中:  28% |##########################                                                                  | ETA:   0:00转换中:  41% |#####################################                                                       | ETA:   0:00转换中:  53% |#################################################                                           | ETA:   0:00转换中:  58% |######################################################                                      | ETA:   0:00转换中:  69% |################################################################                            | ETA:   0:00转换中:  82% |###########################################################################                 | ETA:   0:00转换中:  89% |##################################################################################          | ETA:   0:00转换中: 100% |############################################################################################| Time:  0:00:01

将短片段语音发送给Google Speech V2 API并得到识别结果。
语音转文字中:   0% |                                                                                         | ETA:  --语音转文字中:   0% |                                                                                         | ETA:  --语音转文字中:  28% |#########################                                                                | ETA:   0语音转文字中:  48% |##########################################                                               | ETA:   0语音转文字中:  76% |####################################################################                     | ETA:   0语音转文字中: 100% |#########################################################################################| Time:  0:00:00
语音字幕文件创建在了"C:\Users\Administrator\Downloads\LANREN\LANREN.ja-jp.srt"。

做完了。

输出的字幕样式:
1
00:00:00,170 --> 00:00:04,950

2
00:00:05,130 --> 00:00:09,270

3
00:00:09,570 --> 00:00:19,560

4
00:00:19,570 --> 00:00:29,560

期待的行为
希望大佬修复

操作环境(请提供以下完整数据):

  • 操作系统: windows10 1909
  • Python版本: Python 3.10
  • Autosub版本: 0.5.7a0-ALPHA和DEV

额外信息(可选)
任何其他的能描述问题的信息。

@0x000-0
Copy link

0x000-0 commented Dec 15, 2021

我也遇到了

@BingLingGroup
Copy link
Owner

经测试,speechv2 api目前仍能正常响应请求。鉴于你这个根本没到翻译那一步,且参数有误,只能执行语音转文字的部分,故给出以下建议。

#167 (comment)网络问题

@BingLingGroup BingLingGroup changed the title 安装最新版dev和alpha只生成时间轴,翻译错误 安装最新版dev和alpha只生成时间轴,无法正常进行语音转文字 Dec 16, 2021
@ainy0315
Copy link
Author

解决了,我用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

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

3 participants