ssl - 收到错误:[SSL: BAD_LENGTH] 长度错误 (_ssl.c:2408)
问题描述
我做了一个可以用语音命令控制的游戏。要将所有语音命令转换为文本,我使用了 IBM Cloud Speech to Text 服务。一切都完成了,只是它向我显示了 BAD LENGTH ERROR,正如您在图像中看到的那样。
这是语音到文本的代码:
###############################################
#### Initalize queue to store the recordings ##
###############################################
CHUNK = 1024
# Note: It will discard if the websocket client can't consumme fast enough
# So, increase the max size as per your choice
BUF_MAX_SIZE = CHUNK * 10
# Buffer to store audio
q = Queue(maxsize=int(round(BUF_MAX_SIZE / CHUNK)))
# Create an instance of AudioSource
audio_source = AudioSource(q, True, True)
###############################################
#### Prepare Speech to Text Service ########
###############################################
# initialize speech to text service
authenticator = IAMAuthenticator('i3gkxvESZRUHnt0_Iv2PtMQaHd2roF1YgvTTIzq0tbop')
speech_to_text = SpeechToTextV1(authenticator=authenticator)
speech_to_text.set_service_url("https://api.eu-gb.speech-to-
text.watson.cloud.ibm.com/instances/54f44656-b15c-4a16-8dac-c5b782482f93")
actions = []
解决方案
通过卸载所有软件包并重新安装所需的软件包,我解决了该错误。它只会成功运行,即使您将来收到该错误,请再次尝试执行此过程。它会起作用的。除此之外,我找不到任何其他解决方案。
推荐阅读
- ios - InAppBrowser 事件处理程序未触发:Ionic 5 + Angular 10 + Capacitor
- python - 如何将 pandas 数据帧转换为带有标题的多级 JSON?
- maven - apache maven 构建失败 - 无法执行目标 org.apache.felix:maven-bundle-plugin:4.2.0:manifest
- postgresql - Postgresql 从带有换行符列的文本文件中复制
- python - 计算熊猫数据框中没有日期的持续时间
- webspeech-api - DOMException: 无法启动音频源
- java - 如何使用while循环从文本文件中读取
- assembly - 组装中的“对齐堆栈”是什么意思?
- ios - SafariView 只加载一个 url,似乎无法加载另一个
- python - from pyzbar.pyzbar import decode 在google colab上运行时出错