Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions tauri/src/components/ui/call-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions tauri/src/windows/main-window/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading