收到错误。[SSL: BAD_LENGTH]坏的长度(_ssl.c:2408)

问题描述 投票:0回答:1

我做了一个可以用语音命令控制的游戏。为了将所有的语音命令转换为文本,我使用了IBM Cloud Speech to Text服务。除了显示BAD LENGTH ERROR之外,一切都已完成,如图所示。 enter image description here

这就是语音转文字的代码。

###############################################
#### 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 = []
ssl openssl runtime-error ibm-cloud signals-slots
1个回答
0
投票

我只需卸载所有的包,然后重新安装需要的包,就可以解决这个错误。即使你以后收到这个错误,也可以再做一次这个过程,就会成功。除此以外,我一直没有找到其他的解决办法。

© www.soinside.com 2019 - 2024. All rights reserved.