Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Real-time Speech-To-Text Tutorial - Part 3
import json
async def receive_data():
"""
Asynchronous function used for receiving data
"""
while True:
try:
received_msg = await ws_connection.recv()
print(json.loads(received_msg)['text'])
except Exception as e:
print(f'Something went wrong. Error code was {e.code}')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment