Vapi Web SDK Doesn't Support Starting Call Muted
# support
l
You can't begin a Vapi web call with the user's microphone muted. This makes a push-to-talk feature I'm building error prone. I've created a pull request on the github repo that fixes this, would love someone to merge this as is harmless otherwise: https://github.com/VapiAI/client-sdk-web/pull/105
m
just curious on the usecase, why not start it and then mute it on connection
l
There will always be a brief moment where the microphone is unmuted after connection. If there's noise going during connection (e.g. user is speaking to someone that's not the agent) it will trigger a response from the agent. We don't want the agent responding unless explicitly spoken to.
@Adi [Vapi] I see you're the primary contributor to the repo, if you wouldn't mind taking a look at this that'd be great.
a
Hi @Lennui yes, I can take a look at the PR today and get back to you
l
@Lennui I was also looking into this use case a few weeks ago, I was able to start the conversation without the microphone enabled, but the Daily room would be destroyed after 10 seconds if the microphone wasn't unmuted
a
Hello Lennui, I believe the team is reviewing your PR. If everything looks good they'll review & merge. Thank you for the suggestion! In the meantime if you need a quick fix you can absolutely mute it right after your run vapi.start long before it picks up any noise. I know of a few customers who have it in production working this way.
l
Interesting, I'm currently muting immediately after vapi.start and if we're speaking while vapi.start runs it will pick up a very brief bit of audio and will respond confusedly
@Adi [Vapi] is there any chance of getting that PR looked at today? It's a single line change that just enables a passthrough to the underlying Daily call. Sorry for pinging, this is just blocking some sales demos for our team.
l
@Lennui any reason you wouldn’t want to just start the call without enabling the microphone at all?
l
Thanks for the comment @User ! I'd initially tried this but then was unable to actually mute/unmute the microphone. Now looking at Daily's docs I see if you pass your own stream in you have to manage its own lifecycle: https://docs.daily.co/reference/daily-js/daily-call-client/properties#audioSource Makes sense in retrospect. Now that I'm enabling/disabling the track directly rather than using setMuted(true|false) It seems to have solved my problem.
l
@Lennui Ok interesting, this was a couple of months ago but I was able to start a call with the SDK without enabling the microphone but then ran into a subsequent issue with Daily so I dropped that feature for the time being. What I was trying to achieve was to prevent the initial permissions check to enable the microphone, then have the ability to opt-in to use the microphone later in the call (essentially starting the call with text from the user and voice from the assistant). Anyways it seems like you've got it figured out for your use case so best of luck! I'll be revisiting Daily's docs soon so if I come across something that may help your cause I'll let you know.