deaf

View as Markdown

deaf

  • deaf(params): Promise<void>

Mutes the incoming audio for a given member. The affected participant will not hear audio from the other participants anymore.

Note that in addition to making a participant deaf, this will also automatically mute the microphone of the target participant. If you want, you can then manually unmute it by calling audioUnmute.

Parameters

params
objectRequired

Object containing the parameters of the method.

memberId
string

ID of the member to affect.

Returns

Promise<void>

Example

1import { SignalWire } from "@signalwire/realtime-api";
2
3// Initialize the SignalWire client
4const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
5
6// Access the video client from the main client
7const videoClient = client.video;
8
9// Setup listener for when a room starts
10await videoClient.listen({
11
12 onRoomStarted: async (roomSession) => {
13 console.log("Room started", roomSession.displayName);
14 await roomSession.listen({
15 // Listen for when a member joins the room
16 onMemberJoined: async (member) => {
17 console.log("Member joined", member.name);
18 // Deafen the member
19 console.log("Deafing member", member.name);
20 await roomSession.deaf({ memberId: member.id });
21 }
22 });
23 },
24 onRoomEnded: async (roomSession) => {
25 console.log("Room ended", roomSession.displayName);
26 }
27});