#{ type: 'Metadata', transaction_key: 'deprecated', request_id: 'b6a7b90c-742f-452c-8a5b-1f18dc

1 messages · Page 1 of 1 (latest)

ebon wave
#

when i am connect with socket via node sdk this i am getting into transriptionReceived event
i am sending binary data to deepgram

unborn bear
#

Are you worried about "transaction_key": "deprecated" ?

ebon wave
#

but it should return me transcript right?

#

{
type: 'Metadata',
transaction_key: 'deprecated',
request_id: 'cfd443da-bf36-41dd-81db-ca5f4cdf7ecf',
sha256: '9c494a018d8c8470448725357048958679434a05e82a88cab1ab9181cab439af',
created: '2023-07-25T11:45:58.012Z',
duration: 0,
channels: 0
}

#

this is what i get

unborn bear
#

if you're using a websocket, you'll get further events with transcription data

#

that is just the metadata event

ebon wave
unborn bear
#

Are you using Safari?

ebon wave
#

no i am using chrome

unborn bear
#

hmmmm that's interesting

ebon wave
#

can you please check above code of your repo it seems like i miss something

unborn bear
#

"alternatives" is part of our response, so you are getting something but the format is malformed

#

could you run npm i @deepgram/sdk to install the latest SDK version

#

this may break it more

#

hopefully it fixes it though 🤞

ebon wave
#

{
type: 'Metadata',
transaction_key: 'deprecated',
request_id: '3ddb8ff7-b731-465d-be33-13a6ca78f29f',
sha256: '40f06030d7a3b888b431e27c4627a9299e1d8b90142b59835d9386e2fa218c40',
created: '2023-07-25T12:01:31.320Z',
duration: 0,
channels: 0
}

#

still facing same issue brother

#

"@lyric flicker/sdk": "^2.3.0",

#

what will be the socket version?

unborn bear
#

the metadata will never change

#

the error that follows it is the problem

#

I've asked if someone on my team can look at it once they're online

ebon wave
#

yes absolutely thanks i am waiting for your response

unborn bear
#

❤️ thanks for your patience

ebon wave
#

@unborn bear any update?

unborn bear
#

My team are in the US, they're still in bed 😬

ebon wave
#

ohh my bad

ebon wave
#

@unborn bear any update?

unborn bear
#

Someone has been able to reproduce it and are looking into it

ebon wave
#

ohh awesome good to here

slate ridge
#

I am on this, let's try to see what is wrong

ebon wave
#

Hi @slate ridge Thanks for looking

slate ridge
#

yes, I have that cloned on my machine

#

trying to run it

ebon wave
#

nice

slate ridge
#

what do you get when you try to log the deepgram result??

#

Also, just to confirm. Do you happen to have anything running on the 3000 port?

ebon wave
#

no

#

i am getting this #1133356392108011621 message

slate ridge
#

interesting

ebon wave
#

did you change any thing?

slate ridge
#

so you are not getting any alternatives?

ebon wave
#

yes

unborn bear
#

Saarth you said you were getting the error too

slate ridge
#

I upgraded the deepgram sdk to the latest version

#

I think I was but it seems to have been gone, interestingly

#

I also had some other thing running on the same port

#

so idk if that is what was causing it

ebon wave
#

anything i need to configure in console of deepgram?

slate ridge
#

nvm I think i just got the same error when I restarted the server

#

let me quickly check

#

dgLive WEBSOCKET CONNECTION OPEN!
dgJSON {
type: 'Metadata',
transaction_key: 'deprecated',
request_id: 'e79abe94-f3e2-4854-a9ab-fe19634bd09a',
sha256: '7d28fc2221a22e395aa234562e87fbe85484c17eae9b5bfd0add8231beb1ca7f',
created: '2023-07-25T16:46:42.428Z',
duration: 0,
channels: 0
}
WARNING: parsing dgJSON failed. Response from dgLive is: TypeError: Cannot read properties of undefined (reading 'alternatives')
at t.<anonymous> (file:///Users/deepgram/Desktop/Saarth/node-live-example/server.js:70:34)
at t.emit (node:events:511:28)
at _socket.onmessage (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:24020)
at T.a (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:52621)
at T.emit (node:events:511:28)
at e.exports.I (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:86715)
at e.exports.emit (node:events:511:28)
at e.exports.dataMessage (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:66926)
at e.exports.getData (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:66108)
at e.exports.startLoop (/Users/deepgram/Desktop/Saarth/node-live-example/node_modules/@deepgram/sdk/dist/index.js:1:62969)
{
type: 'Metadata',
transaction_key: 'deprecated',
request_id: 'xxxxxxxxxxx',
sha256: 'xxxxxxxxxxxxxxxxxxxx',
created: '2023-07-25T16:46:42.428Z',
duration: 0,
channels: 0
}
dgLive CONNECTION CLOSED!

#

are you getting the same thing?

ebon wave
#

yes

slate ridge
#

okay lemme check this

#

ok do one thing for me

#

close the tab which has the microphone enabled

#

and close the node server too

#

this is just a temporary fix to see if we can get this working for you and then i can figure out why the result is not responding with the alternatives once we get it up and running for you

ebon wave
#

okay

#

let me try this

slate ridge
#

yea close both things

#

and then run the node server first

ebon wave
#

same issue

slate ridge
#

interesting

#

let me think

ebon wave
#

yes😐

slate ridge
#

could it be a microphone issue @unborn bear ?

#

maybe the data is not being sent?

unborn bear
#

It sounds to me like a race condition between the microphone being ready to send data, and the websocket closing because it recieved no data.

ebon wave
#

do i need to configure any thing in deepgram console?

slate ridge
#

yea, I agree

#

I think the connection is closing before the microphone is sending the first datapoint

unborn bear
#

I think the code needs to be a little more robust in this example. Perhaps look at KeepAlive too.

slate ridge
#

yea I can fix it

unborn bear
#

💪

slate ridge
#

how many seconds should we ideally wait??

ebon wave
#

nice that

unborn bear
#

Keep sending KeepAlive in a 5s timer

#

but also send it as soon as you connect

#

IMO

slate ridge
#

ok

#

lemme try that

unborn bear
slate ridge
#

yes @ebon wave give me some time, I'll get back to you

ebon wave
#

Thanks man

slate ridge
#

ofc

slate ridge
#

@unborn bear it is interesting that it is closing the websocket even after the keep alive is being sent

ebon wave
#

@slate ridge is that fix?

slate ridge
#

I am still working on it

ebon wave
#

okay please let me know if anything needs from my side

slate ridge
#

fs, i'll keep you in the loop. Had to finish something else in the meanwhile so had taken a short break

ebon wave
#

okay

slate ridge
#

I have reached out to a product manager on the team to get some idea as to why this might be happening

ebon wave
#

ohh okay

slate ridge
#

yup, I will get back when I figure out something or if he tells me why this might be happening

slate ridge
#

okay, so deepgram is basically not receiving audio and that is why there is a response with no transcripts

unborn bear
#

the error is that "alternatives" is missing or coming back empty? what a lovely misleading error...

slate ridge
#

the reason why it is closing like that is because we are sending an empty byte of data, which will signal DG to close the connection

unborn bear
#

❗ I knew that

slate ridge
#

so ideally it should not close the websocket

#

this definitely has to do with sending an empty byte of data because otherwise the deepgram websocket would not disconnect for upto 12 seconds

#

and in our case, it is closing in 2 seconds

unborn bear
#

yeh, hence the 5s keep alive

#

seems like an issue using the Media object

slate ridge
#

no but the empty byte is forcing it to close

#

I tried seding the KeepAlive

#

but it did not help

unborn bear
#

Yeh the empty byte is a command of it's own, basically

slate ridge
#

"The websocket will close any time an empty byte of data is sent, so you need to be careful to not send that unless you want to"

  • Shir (TPM for streaming)
unborn bear
#

Sending an empty byte would be the side effect of a problem getting an empty event from the Media object

slate ridge
#

yes

#

so it's not a problem with the api and more so from whatever is being used to record audio

unborn bear
#

compare how that is being done vs the other project you're working on I guess

#

😄

slate ridge
#

so for the other project, we open the websocket connection anytime a button is clicked

unborn bear
#

you know I hadn't even considered that other project when you looked at this LOL

slate ridge
#

here it is being opened anytime, there is somebody on the link

#

should we update that and add a button??

#

Also, @ebon wave maybe you also want to check your microphone

#

especially when you first start the server and go to the localhost

unborn bear
#

no i don't think the button is the way, i think it is a race condition between the socket opening and the microphone being ready

slate ridge
#

yea

#

I think so too

#

or the microphone not working at all

unborn bear
#

but you replicated it remember

#

lets talk offline and think of a solution

slate ridge
#

yes

#

we can talk about this tomorrow morning

#

I am about to head home in 5

unborn bear
#

💪

slate ridge
#

👍

ebon wave
#

have you guyz fixed it if yes then can you please send me the latest code?

ebon wave
#

hello

unborn bear
#

hey I'm going to be looking at this tomorrow

ebon wave
#

okay

ebon wave
#

any update @unborn bear ?

unborn bear
#

Yeh I think I fixed it in just doing a few other changes while I'm there.

There is a race condition between the socket being open and the mic sending data.

But the error is being caused because it is trying to get alternatives from every response. Some responses are metadata.

You can wrap the whole JSON.parse section and following code inside an IF that checks for dgJSON.type==="result"

You may still have the socket close due to the race condition

#

I'll make a PR today with a new version of this demo

ebon wave
#

thanks please update me as soon as you pushed new version

unborn bear
#

@ebon wave PR is up, waiting for a colleague to approve it. But you could pull and switch to that branch. Follow the README from fresh, as it's very different now.

ebon wave
#

yes thanks

unborn bear
#

Now updated

rough quartz
#

hello @unborn bear I am facing same issue again.I was busy in demo.Just now i tested again facing same issue.

Transcription ==> {
type: 'Metadata',
transaction_key: 'deprecated',
request_id: 'e9386e60-d025-4fb2-8eac-90b401f0e3cf',
sha256: 'c05ad6ed012ae67dbdb9a75199babfffb605b068c0943cef433c168feb1af55e',
created: '2023-09-24T10:57:35.475Z',
duration: 0,
channels: 0
}

Whats the reason i can see you are using keepAlive is that compulsory.
I am transcribing live phone calls..

Can you please provide solution although i send mail to Dustin Shubert but dont know he is busy.

rough quartz
#

Hello @unborn bear Can you Please provide solution on above issue?