Skip to content

Commit

Permalink
received audio frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Sep 23, 2024
1 parent 365de80 commit c5f4726
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/wgpu_room/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ impl LkApp {
);
self.video_renderers
.insert((participant.identity(), track.sid()), video_renderer);
} else if let RemoteTrack::Audio(_) = track {
// TODO(theomonnom): Once we support media devices, we can play audio tracks here
} else if let RemoteTrack::Audio(ref audio_track) = track {
let rtc_track = audio_track.rtc_track();
let mut audio_stream = NativeAudioStream::new(rtc_track);
tokio::spawn(async move {
// Receive the audio frames in a new task
while let Some(audio_frame) = audio_stream.next().await {
log::info!("received audio frame - {audio_frame:#?}");
}
});
}
}
RoomEvent::TrackUnsubscribed {
Expand Down

0 comments on commit c5f4726

Please sign in to comment.