I'm working on a CLI Go app to run in the background on my Linux server. This is an implementation of pion/webrtc. My Go app is connecting to the Janus, but not receiving or sending audio. I need to send microphone audio and receive audio from Janus. I guess that I should link my audio sink/source in pion, but I'm confused.
I'm not sure about this code:
// Create a audio track
opusTrack, err := webrtc.NewTrackLocalStaticSample(webrtc.RTPCodecCapability{MimeType: "audio/opus"}, "audio", "pion")
if err != nil {
panic(err)
} else if _, err = peerConnection.AddTrack(opusTrack); err != nil {
panic(err)
}
Neither this:
gst.CreatePipeline("opus", []*webrtc.TrackLocalStaticSample{opusTrack}, "audiotestsrc").Start()
I used the sample code of pion/example-webrtc-applications/janus-gateway.
My whole code here.
Thanks for helping!