https://retellai.com/?utm_source=discord&utm_medium=seo logo
Unable to get websocket audio and transcript worki...
# ❓・bug-report
s
my use case is to make an outbound call to a specific phone number, then get a live transcript and live audio of the call while it's happening. using my current code, the call starts then immediately terminates automatically. what's wrong?
s
@smellerbeez did you ever figure it out?
s
@smandava no
It would be great if there was a working code example somewhere
n
@smellerbeez I dont think the retell-client-js-sdk is compatible with a phone call. It works only with a web call. Here you are doing a phone call (client.call.create), instead the supported way of doing this is to register a web call and then pass that call_id in the client js sdk. If you want to use a phone call-based setup, you can write some code using a custom LLM where you use one more websocket to connect your frontend with backend and pass the transcripts on that web socket.
s
@NJ @smandava how do i get the live audio as well? the solution that people have mentioned to me is to 1. stream the audio from twilio to my backend 2. send the audio to my frontend and retell's servers 3. stream back the transcript and audio response from twilio 4. send the audio to twilio and my frontend 5. send the transcript to my frontend
surely there's a cleaner solution than this. i'm basically reimplementing all of retell's twilio piping just to get the audio and transcript
n
@smellerbeez In the context of a phone call, Retell currently does not support access to live audio. Also, transcripts are only accessible directly during the custom LLM implementation (which I have already outlined above) For audio, I believe the best way should be using Twilio. Something like this: https://www.twilio.com/docs/voice/tutorials/consume-real-time-media-stream-using-websockets-python-and-flask
s
am i not basically implementing retell's whole stack from scratch if i do custom llm + twilio?
n
Well for starters you are not re-implementing anything related to transcription (speech to text) and synthesis (text to speech). These layers are still given by retell. You will have to implement your LLM part only and for that there are a couple of github repos for reference