#{ type: 'Metadata', transaction_key: 'deprecated', request_id: 'b6a7b90c-742f-452c-8a5b-1f18dc
1 messages · Page 1 of 1 (latest)
Are you worried about "transaction_key": "deprecated" ?
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
if you're using a websocket, you'll get further events with transcription data
that is just the metadata event
https://github.com/deepgram-devs/node-live-example i am running this
Are you using Safari?
no i am using chrome
hmmmm that's interesting
can you please check above code of your repo it seems like i miss something
"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 🤞
{
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?
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
yes absolutely thanks i am waiting for your response
❤️ thanks for your patience
@unborn bear any update?
My team are in the US, they're still in bed 😬
ohh my bad
@unborn bear any update?
Someone has been able to reproduce it and are looking into it
ohh awesome good to here
I am on this, let's try to see what is wrong
Hi @slate ridge Thanks for looking
https://github.com/deepgram-devs/node-live-example i want to run this fluently
nice
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?
did you change any thing?
so you are not getting any alternatives?
yes
Saarth you said you were getting the error too
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
anything i need to configure in console of deepgram?
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?
yes
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
yea close both things
and then run the node server first
and then open the http://localhost:3000/
same issue
yes😐
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.
do i need to configure any thing in deepgram console?
Nope
yea, I agree
I think the connection is closing before the microphone is sending the first datapoint
I think the code needs to be a little more robust in this example. Perhaps look at KeepAlive too.
yea I can fix it
💪
how many seconds should we ideally wait??
nice that

yes @ebon wave give me some time, I'll get back to you
Thanks man
ofc
@unborn bear it is interesting that it is closing the websocket even after the keep alive is being sent
@slate ridge is that fix?
I am still working on it
okay please let me know if anything needs from my side
fs, i'll keep you in the loop. Had to finish something else in the meanwhile so had taken a short break
okay
I have reached out to a product manager on the team to get some idea as to why this might be happening
ohh okay
yup, I will get back when I figure out something or if he tells me why this might be happening
okay, so deepgram is basically not receiving audio and that is why there is a response with no transcripts
the error is that "alternatives" is missing or coming back empty? what a lovely misleading error...
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
alternatives is missing, but it is in a try catch block
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
no but the empty byte is forcing it to close
I tried seding the KeepAlive
but it did not help
Yeh the empty byte is a command of it's own, basically
"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)
Sending an empty byte would be the side effect of a problem getting an empty event from the Media object
yes
so it's not a problem with the api and more so from whatever is being used to record audio
so for the other project, we open the websocket connection anytime a button is clicked
you know I hadn't even considered that other project when you looked at this LOL
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
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
💪
👍
have you guyz fixed it if yes then can you please send me the latest code?
hello
hey I'm going to be looking at this tomorrow
okay
any update @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
thanks please update me as soon as you pushed new version
@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.
yes thanks
Now updated
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.
Hello @unborn bear Can you Please provide solution on above issue?
