diff --git a/tauri/src/components/ui/call-center.tsx b/tauri/src/components/ui/call-center.tsx index da1c71f..8a20da4 100644 --- a/tauri/src/components/ui/call-center.tsx +++ b/tauri/src/components/ui/call-center.tsx @@ -11,7 +11,15 @@ import { useRoomContext, useTracks, } from "@livekit/components-react"; -import { Track, ConnectionState, RoomEvent, VideoPresets, LocalTrack, ParticipantEvent } from "livekit-client"; +import { + Track, + ConnectionState, + RoomEvent, + VideoPresets, + LocalTrack, + ParticipantEvent, + AudioPresets, +} from "livekit-client"; import { useCallback, useEffect, useRef, useState } from "react"; import { Select, SelectContent, SelectItem, SelectTrigger } from "./select"; import { SelectPortal } from "@radix-ui/react-select"; @@ -616,7 +624,16 @@ function MediaDevicesSettings() { ); if (roomState === ConnectionState.Connected) { console.debug(`Setting microphone enabled: ${callTokens?.hasAudioEnabled}`); - localParticipant.setMicrophoneEnabled(callTokens?.hasAudioEnabled); + localParticipant.setMicrophoneEnabled( + callTokens?.hasAudioEnabled, + { + channelCount: 1, + }, + { + audioPreset: AudioPresets.speech, + forceStereo: false, + }, + ); localParticipant.setCameraEnabled( callTokens?.hasCameraEnabled, diff --git a/tauri/src/windows/main-window/app.tsx b/tauri/src/windows/main-window/app.tsx index c0b9f6d..20d4337 100644 --- a/tauri/src/windows/main-window/app.tsx +++ b/tauri/src/windows/main-window/app.tsx @@ -201,6 +201,9 @@ function App() { // to be cleaner and easier to manage useEffect(() => { socketService.on("incoming_call", (data: TWebSocketMessage) => { + if (data.type !== "incoming_call") { + return; + } // Check that there is no on-going call // If there is, reject the call const { callTokens } = useStore.getState();