https://retellai.com/?utm_source=discord&utm_medium=seo logo
For iOS Safari & Google Chrome call button not wor...
# ❓・bug-report
v
We developed the button according to the retell and retell-react-sdk documentation. I have the button working on my iPhoneXR, but for some reason it doesn't get any recording from my microphone according to the logs. I don't hear the greeting phrase intermittently either. My colleague has an iPhone 8 and he doesn't have the button active at all.
n
Are you getting any errors in the logs or is it just that the microphone is not recording anything?
v
@NJ No, I don't get anything. I only see in the web sockets console that binary files are being sent I'm willing to get together and show you how I have it working, I'm afraid the problem is with the retell sdk as the button in beta.retell works
@NJ can you help me?
i
@Zexia - Retell AI can you help ?
z
can you try logging the audio you sent and the audio you receive to see if meaningful bytes are being transmitted?
v
@Zexia - Retell AI If anything, @ievgenr is a colleague of mine We prepared 2 screencasts, connected the iPhone to macbook and opened devtools on safari ios. We can see from the websockets that we send binary messages, but we get nothing in response. Also we didn't get the welcome phrase Call Id: 4b8a6325e2c5f21aca1f07afb4f04b92
z
I've taken a look at the logs of the call, and I can confirm we are sending out audio bytes, and received all 0 bytes (silence) from you
I suspect you were selecting a different mic and speaker for your setup
v
Sorry, but we don't manage this in any way, we use your sdk. https://github.com/RetellAI/retell-client-js-sdk
z
you can use customSinkId to specify the audio playback to be used. Generally you can also change the default audio capture and playback device in chrome settings,
v
Can you please provide a link to the documentation? And the problem is apparently in the sdk, since on beta.retellai.com the test button on ios works
z
our dashboard uses the SDK as well
right now there's not much docs around the sink id, but you can look into the SDK code for that and pass that in
v
@Zexia - Retell AI Thank you so much for your support! We are playing around with shinkId now, so far this code has come out for clarity. On macOS in Safari, for some reason the bot skips the welcome phrase and can only answer one question "can you hear me?".
Copy code
ts
            // @ts-ignore
            const permission = await navigator.permissions.query({ name: "microphone" });
            console.log(permission.state);
            if (permission.state === "prompt") {
                // More audio outputs are available when user grants access to the mic.
                // @ts-ignore
                const stream = await navigator.mediaDevices.getUserMedia({ audio: true });

                // @ts-ignore
                stream.getTracks().forEach((track) => track.stop());
            }

            // Request a list of media devices and filter audio output devices.
            // @ts-ignore
            const devices = await navigator.mediaDevices.enumerateDevices();

            // @ts-ignore
            const audioOutputs = devices.filter(device => device.kind == "audiooutput");

            // @ts-ignore
            const audioContext = new AudioContext();

            console.log(audioOutputs);
            // @ts-ignore
            if ("setSinkId" in AudioContext.prototype) {
                // Pick the first available audio output.
                const deviceId = audioOutputs[0].deviceId;

                if (deviceId !== "default") {
                    await audioContext.setSinkId(deviceId);
                }
            }
            
            webClient
                .startConversation({
                    callId: registerCallResponse.call_id,
                    sampleRate: 24000,
                })
                .catch(console.error);
An article from Google has come to our rescue https://developer.chrome.com/blog/audiocontext-setsinkid
@Zexia - Retell AI Hi! Your demo doesn't work on iOS and Android either, as well as macOS in Safari. Could you please modify it to make it work? https://github.com/RetellAI/retell-frontend-reactjs-demo
@Zexia - Retell AI can you help me?
@Zexia - Retell AI sorry?
z
Hey sorry the demo uses Web Audio API, and can have unexpected behaviors in non chrome environments. We expect the demo to work in IOS and Android chrome env.