Add joined sound effect when new participants join the room

Mikayla Maki created

Change summary

crates/call/src/call.rs | 10 +++-------
crates/call/src/room.rs |  7 ++++++-
2 files changed, 9 insertions(+), 8 deletions(-)

Detailed changes

crates/call/src/call.rs 🔗

@@ -10,19 +10,15 @@ use futures::{future::Shared, FutureExt};
 use postage::watch;
 
 use gpui::{
-    AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription,
-    Task, WeakModelHandle,
+    AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription, Task,
+    WeakModelHandle,
 };
 use project::Project;
 
 pub use participant::ParticipantLocation;
 pub use room::Room;
 
-pub fn init(
-    client: Arc<Client>,
-    user_store: ModelHandle<UserStore>,
-    cx: &mut AppContext,
-) {
+pub fn init(client: Arc<Client>, user_store: ModelHandle<UserStore>, cx: &mut AppContext) {
     let active_call = cx.add_model(|cx| ActiveCall::new(client, user_store, cx));
     cx.set_global(active_call);
 }

crates/call/src/room.rs 🔗

@@ -663,6 +663,8 @@ impl Room {
                                 },
                             );
 
+                            Audio::play_sound(Sound::Joined, cx);
+
                             if let Some(live_kit) = this.live_kit.as_ref() {
                                 let video_tracks =
                                     live_kit.room.remote_video_tracks(&user.id.to_string());
@@ -1363,7 +1365,10 @@ impl LiveKitRoom {
                 let old_muted = *muted;
                 *muted = should_mute;
                 cx.notify();
-                Ok((cx.background().spawn(track_publication.set_mute(*muted)), old_muted))
+                Ok((
+                    cx.background().spawn(track_publication.set_mute(*muted)),
+                    old_muted,
+                ))
             }
         }?;