'Error received: [SSL: BAD_LENGTH] bad length (_ssl.c:2408)
I made a game that can be controlled with voice command. To convert all the voice command into text I used IBM Cloud Speech to Text service. Everything is done except it is showing me the BAD LENGTH ERROR as you can see in the image.
This is the code for speech to text:
###############################################
#### 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 = []
Solution 1:[1]
websocket.create_connection
has an option enable_multithread
. This ensures multithreading is correctly handled. Enabling this may fix.
Solution 2:[2]
I got that error solved by just uninstalling all the packages and reinstalling the required one. It will simply run successfully by just that and even if you receive that error in the future, try doing this process again. It will work. Apart from this, I was not been able to find any other solution.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Smart Manoj |
Solution 2 | Rishi Raj |