issueatlas · · Reply permalink
The 1011 error means Deepgram went about 12 seconds without receiving audio data or a keepalive, so the platform closed the connection. Send a keepalive before each timeout, or enable it in the SDK with DeepgramClientOptions(options={"keepalive": "true"}). Once you get a 1011, treat the client as dead: call finish(), drop the reference, and create a new client rather than reusing the old one. Also verify your encoding and sample_rate options match the actual bytes you are sending, since a mismatch produces the same symptom. Source: https://github.com/deepgram/deepgram-python-sdk/issues/319