Adding audio track to PeerConnection #1244
-
Hello! I'm trying to send audio data over a peer connection and I'm not sure that my setup for that is correct. Both sides of the connection use libdatachannel for WebRTC. Establishing the peer connection works and I can send data over the datachannel, but when I add an audio track and then try to send data via Track::send() I just get warnings on the server side:
When initializing the peer connection I made sure to set
The code to add the track looks like this:
where
I noticed that I do not see the "Track added" message on the remote peer connection, so I'm not sure if the remote peer is even aware that the track was added. And when I start sending data to the track, I get the messages about unknown packet types on the other end. Am I missing a step in setting up the connection? Any hints and tipps on how to establish an audio connection between two libdatachannel peer connections would be greatly appreciated! Thanks in advance and best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
There are a few things missing:
|
Beta Was this translation helpful? Give feedback.
Yes indeed, if you send the same format in both directions, you need to set up the track the same way in
onTrack()
.