Trouble closing, then re-creating deepgram instance #535
-
|
I am building a conversational app. The user clicks a button, then speaks into the microphone to have their speech transcribed by deepgram. This works perfectly fine on the initial run. The user can speak back and forth with the AI no problem. Here is the relevant Client-Side and Server-Side code: Client-Side Am I missing something? Once metadata is received (and console logs deepgram: metadata received), I am unable to re-create an instance to send data afterwards. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Thanks for asking your question about Deepgram! If you didn't already include it in your post, please be sure to add as much detail as possible so we can assist you efficiently, such as:
|
Beta Was this translation helpful? Give feedback.
-
|
How could I have missed such a simple solution? Despite setting DeepInstance to "" on cleanup, it actually becomes null for some reason. So by adding the null check, the new instance is created properly. //Cleanup //Create instance |
Beta Was this translation helpful? Give feedback.
How could I have missed such a simple solution?
Despite setting DeepInstance to "" on cleanup, it actually becomes null for some reason. So by adding the null check, the new instance is created properly.
//Cleanup
userMap.get(id).setDeepInstance("");
//Create instance
if (userMap.get(id).deepInstance === "" || userMap.get(id).deepInstance === null) {
userMap.get(id).setDeepInstance(createNewDeepgram());
}