diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 41eb3952547055..117562d5910082 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -1322,7 +1322,7 @@ impl Room { cx.spawn(move |this, mut cx| async move { let (track, stream) = - livekit::create_audio_track_from_microphone(&cx.background_executor()).await?; + livekit::capture_local_audio_track(&cx.background_executor()).await?; let publication = participant .publish_track( @@ -1403,8 +1403,7 @@ impl Room { let sources = sources.await??; let source = sources.first().ok_or_else(|| anyhow!("no display found"))?; - let (track, _stream) = - livekit::create_video_track_from_screen_capture_source(&**source).await?; + let (track, _stream) = livekit::capture_local_video_track(&**source).await?; let publication = participant .publish_track( diff --git a/crates/live_kit_client/examples/test_app.rs b/crates/live_kit_client/examples/test_app.rs index 9df7960b131268..d9e5a37121b28b 100644 --- a/crates/live_kit_client/examples/test_app.rs +++ b/crates/live_kit_client/examples/test_app.rs @@ -5,7 +5,7 @@ use gpui::{ WindowHandle, WindowOptions, }; use live_kit_client::{ - create_audio_track_from_microphone, + capture_local_audio_track, options::TrackPublishOptions, play_remote_audio_track, publication::LocalTrackPublication, @@ -254,7 +254,7 @@ impl LivekitWindow { } else { let participant = self.room.local_participant(); cx.spawn(|this, mut cx| async move { - let track = create_audio_track_from_microphone(cx.background_executor()); + let track = capture_local_audio_track(cx.background_executor()); let (track, stream) = track.await?; let publication = participant .publish_track(LocalTrack::Audio(track), TrackPublishOptions::default()) diff --git a/crates/live_kit_client/src/live_kit_client.rs b/crates/live_kit_client/src/live_kit_client.rs index 13dafdb3a3dfac..ce026378191941 100644 --- a/crates/live_kit_client/src/live_kit_client.rs +++ b/crates/live_kit_client/src/live_kit_client.rs @@ -44,7 +44,7 @@ pub fn init(dispatcher: Arc) { livekit::dispatcher::set_dispatcher(Dispatcher(dispatcher)); } -pub async fn create_video_track_from_screen_capture_source( +pub async fn capture_local_video_track( capture_source: &dyn ScreenCaptureSource, ) -> Result<(track::LocalVideoTrack, Box)> { let track_source = NativeVideoSource::new(VideoResolution { @@ -75,7 +75,7 @@ pub async fn create_video_track_from_screen_capture_source( )) } -pub async fn create_audio_track_from_microphone( +pub async fn capture_local_audio_track( cx: &BackgroundExecutor, ) -> Result<(track::LocalAudioTrack, AudioStream)> { let host = cpal::default_host();