Created
November 21, 2021 16:42
-
-
Save gmyrianthous/4ff26d7e32e860efae06e2a1ac82b927 to your computer and use it in GitHub Desktop.
Real-time Speech-To-Text Tutorial - Part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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