#WebGL connection problems

1 messages · Page 1 of 1 (latest)

plain spire
#

Hello, I am trying to connect to deepgram using a webgl unity build but it is refusing to connect. It works fine in editor and a windows build. But webgl is refusing for some reason. I've seen there's a github post about the same issue and I've posted but there is no solution.

The error is: "can’t establish a connection to the server at wss://api.deepgram.com/v1/listen?encoding=linear16&sample_rate=48000"

The following code is used:
` public async void StartListening()
{

  var headers = new Dictionary<string, string>
  {
      { "Authorization", "Token  KEY" }
  };
  websocket = new WebSocket("wss://api.deepgram.com/v1/listen?model=base&encoding=linear16&sample_rate=" + AudioSettings.outputSampleRate.ToString(), headers); 

  
  websocket.OnOpen += () =>
  {
      Debug.Log("Connected to Deepgram!");
  };

  websocket.OnError += (e) =>
  {
      Debug.Log("Error: " + e);
  };

  websocket.OnClose += (e) =>
  {
      Debug.Log("Connection closed! " + e.ToString());
  };

}`

autumn prismBOT
#

Thanks for asking your question. Please be sure to reply with as much detail as possible so the community can assist you efficiently.
-# If you haven't done so, ensure your Discord and Github profiles are linked to Deepgram so you can earn points to redeem on cool stuff just by being active!

#

It looks like we're missing some important information to help debug your issue. Would you mind providing us with the following details in a reply?

  • The deepgram product you are using (e.g Speech to Text, Agent API)
  • A request ID that triggered your error or issue.