For React Native, do you recommend using Krisp in ...
# sdk-native
b
For React Native, do you recommend using Krisp in client or BVC in python on the agent? Is there any noise/echo cancellation by default in RN? We disabled BVC on the agent and felt the audio quality got better, but we have not explicitly added Krisp to client.
r
React Native does have echo cancellation enabled by default. README.md:291-292 The documentation states that "Echo cancellation is available and is enabled by default" when using the bidirectional communication audio session mode. README.md:288-293 Recommendation: Client-side Krisp vs Agent-side BVC For React Native applications, I recommend using Krisp on the client side rather than BVC on the agent, based on the guidance in the codebase The key insight is that both client-side echo cancellation AND server-side noise cancellation can work together effectively. The documentation specifically notes: "When using LiveKit's BVC with real-time models, BVC can be effective. However, client-side echo cancellation must still be enabled to prevent the agent from picking up its own audio output. Why Your Experience Improved Without BVC Your observation that disabling BVC on the agent improved audio quality aligns with the codebase guidance. The knowledge base explains that you should "do not disable echoCancellation, as it's still essential for echo control" even when using server-side solutions. Since React Native already provides echo cancellation by default, adding BVC on the agent side may have been redundant and potentially causing audio processing conflicts. Krisp Implementation in React Native The codebase shows Krisp can be integrated into React Native applications. useKrispNoiseFilter.ts:42-74 There's a
useKrispNoiseFilter
hook available that handles enabling/disabling Krisp noise cancellation on local audio tracks. Important Note Krisp noise cancellation is only available on LiveKit Cloud, not for self-hosted servers. Additionally, Krisp can be CPU-intensive, so for low-powered devices, you might want to conditionally disable it when CPU constraints are detected. optimizing_video_calls_for_low-powered_devices_in_livekit__j.md:34-36
b
Thanks @refined-appointment-81829! I am still debugging AudioSession issues on Expo, I've made some progress. Looks like expo-video keeps setting AVAudioSession.category to "playback" ie overwriting playAndRecord. I will patch their library and create an issue. While debugging I noticed that the localParticipant's microphoneTrack.audioTrack has noiseSuppression=true. Doesn't this goes against what you said above? Does webrtc enable it by default? Or is the event lying...
Copy code
MICROPHONE TRACK {"_constraints": {"autoGainControl": true, "deviceId": "audio", "echoCancellation": true, "noiseSuppression": true, "voiceIsolation": true}, "_currentBitrate": 0, "_events": {"audioTrackFeatureUpdate": [Function anonymous], "cpuConstrained": [Function anonymous], "ended": [[Function anonymous], [Function anonymous]], "muted": [[Function anonymous], [Function anonymous]], "unmuted": [[Function anonymous], [Function anonymous]], "upstreamPaused": [Function anonymous], "upstreamResumed": [Function anonymous]}, "_eventsCount": 7, "_isUpstreamPaused": false, "_maxListeners": 100, "_mediaStreamID": "925D0041-AC6F-4423-9ACF-D3B003AFE2B3", "_mediaStreamTrack": {"_constraints": {"autoGainControl": true, "deviceId": [Object], "echoCancellation": true, "noiseSuppression": true, "voiceIsolation": true}, "_enabled": true, "_muted": false, "_peerConnectionId": undefined, "_readyState": "live", "_settings": {"deviceId": "audio", "groupId": ""}, "id": "925D0041-AC6F-4423-9ACF-D3B003AFE2B3", "kind": "audio", "label": "", "remote": false}, "_sender": {"_id": "925D0041-AC6F-4423-9ACF-D3B003AFE2B3", "_peerConnectionId": 4, "_rtpParameters": [Object], "_track": {"_constraints": [Object], "_enabled": true, "_muted": false, "_peerConnectionId": undefined, "_readyState": "live", "_settings": [Object], "id": "925D0041-AC6F-4423-9ACF-D3B003AFE2B3", "kind": "audio", "label": "", "remote": false}}, "appVisibilityChangedListener": [Function anonymous], "attachedElements": [], "audioContext": undefined, "debouncedTrackMuteHandler": [Function d], "handleEnded": [Function anonymous], "handleKrispNoiseFilterDisable": [Function anonymous], "handleKrispNoiseFilterEnable": [Function anonymous], "handleTrackMuteEvent": [Function anonymous], "handleTrackUnmuteEvent": [Function anonymous], "isInBackground": false, "isKrispNoiseFilterEnabled": false, "isMuted": false, "kind": "audio", "log": {"debug": [Function noop], "disableAll": [Function anonymous], "enableAll": [Function anonymous], "error": [Function bound ], "getLevel": [Function anonymous], "info": [Function noop], "levels": {"DEBUG": 1, "ERROR": 4, "INFO": 2, "SILENT": 5, "TRACE": 0, "WARN": 3}, "log": [Function noop], "methodFactory": [Function defaultMethodFactory], "name": "livekit-track", "rebuild": [Function anonymous], "resetLevel": [Function anonymous], "setDefaultLevel": [Function anonymous], "setLevel": [Function anonymous], "trace": [Function noop], "warn": [Function bound ]}, "loggerContextCb": [Function loggerContextCb], "manuallyStopped": false, "mediaStream": {"_id": "B703E125-FE56-4E67-87BA-060B0BD04726", "_reactTag": "B703E125-FE56-4E67-87BA-060B0BD04726", "_tracks": [[MediaStreamTrack]]}, "monitorSender": [Function anonymous], "muteLock": {"_locking": {"_h": 0, "_i": 1, "_j": undefined, "_k": null}, "_locks": 0}, "pauseUpstreamLock": {"_locking": {"_h": 0, "_i": 3, "_j": [Promise], "_k": null}, "_locks": 0}, "processorLock": {"_locking": {"_h": 0, "_i": 1, "_j": undefined, "_k": null}, "_locks": 0}, "providedByUser": false, "reacquireTrack": false, "restartLock": {"_locking": {"_h": 0, "_i": 1, "_j": undefined, "_k": null}, "_locks": 0}, "sid": "TR_AMEjEBvRPFm22t", "source": "microphone", "stopOnMute": false, "streamState": "active"}
that's probably the reason we had bad call quality, we had noiseSuppression on client and BVC on backend... Can you or any one on your team confirm?