deepgram / deepgram-js-sdk

Official JavaScript SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
138 stars 51 forks source link

cant automatically turn off deepspeech then turn it back on again with microphone volume #105

Closed CaiIsProgrammer closed 1 year ago

CaiIsProgrammer commented 1 year ago

What is the current behavior?

What's happening that seems wrong? Whenever i try to control the data going to deepspeech such as stopping the stream based on volume like this

    if (event.data.size > 0 && time < 1250) {
      console.log("sending data", event.data.size);
      socket.emit("transcriptDG", { gVolume, data: event.data });
    }


it breaks deepspeech but i can stop it manually with a record button turning it off. and it turns back on.

## Steps to reproduce

im not sure how to reproduct it but my code im using that is causing the issue is
front end
https://pastebin.com/EmFz8GPm

backend
https://pastebin.com/xCJyHeUf

> To make it faster to diagnose the root problem. Tell us how can we reproduce the bug.

## Expected behavior

> What would you expect to happen when following the steps above?
i expect it to stop and then when the volume reaches a threshold it picks up where it left off and send the transcript to the client

## Please tell us about your environment

> We want to make sure the problem isn't specific to your operating system or programming language.

- **Operating System/Version:** Windows 10
- **Language:** nodejs
- **Browser:** Chrome

## Other information

> Anything else we should know? (e.g. detailed explanation, stack-traces, related issues, suggestions how to fix, links for us to have context, eg. stack overflow, codepen, etc)

i just get ('Could not send. Connection not open.') even tho i reconnect it via socket.emit("initializeDeep");
briancbarrow commented 1 year ago

@CaiIsProgrammer We had a discussion topic come up before about restarting a connection. Maybe that will help answer your question? https://github.com/orgs/deepgram/discussions/60

lukeocodes commented 1 year ago

Closed as duplicate with no follow up

Answered here: https://github.com/orgs/deepgram/discussions/60