Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Flush Feature #250

Open
dvonthenen opened this issue Mar 26, 2024 · 1 comment
Open

Implement Flush Feature #250

dvonthenen opened this issue Mar 26, 2024 · 1 comment
Milestone

Comments

@dvonthenen
Copy link
Contributor

dvonthenen commented Mar 26, 2024

Proposed changes

You don't need to wait for this to be implemented in the SDK. You can use this right now. You can send the following message in the send() function:

{ "type": "Finalize" }

Context

Possible Implementation

Other information

@tomkail
Copy link

tomkail commented Jun 6, 2024

For others who stumble on this, here's some code and how you might use it:

Our use case is this:

  • Send microphone data each frame.
  • Once the user presses Stop, stop sending data and Flush deepgram.
  • Wait for isFinal event from Deepgram (ensuring we have text for the entire time)
  • Stop Deepgram

I've implemented Flush like this:

byte[] byteArray = Encoding.UTF8.GetBytes("{ \"type\": \"Finalize\" }\n");
            deepgramLive.SendMessage(byteArray);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants