Is there a mechanism for automatic audio configuration in webrtc?

47 views
Skip to first unread message

hin joly

unread,
Jun 5, 2025, 4:51:26 AM6/5/25
to discuss-webrtc
I am making a demo of webrtc. Why can the peer still receive audio without data? The following is the code of my custom audio source (for some reason, OnData inside "qt_audio_source_" is not called)

rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track_(
peer_connection_factory_->CreateAudioTrack(
"kAudioLabel",&qt_audio_source_));
webrtc::RTCErrorOr<rtc::scoped_refptr<webrtc::RtpSenderInterface>> result_or_error =
peer_connection_->AddTrack(audio_track_, {"stream_0"});
if (!result_or_error.ok()) {
qDebug()<< "Failed to add audio track to PeerConnection: "
<< result_or_error.error().message();
Reply all
Reply to author
Forward
0 new messages