1

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!

moigamijunior
  • 85
  • 1
  • 7
  • the first adds track t the peer offer. The second pipes the actual audio / video stream to the net. Read the comments ? –  Sep 27 '21 at 21:48
  • @mh-cbon I know what those lines do. What I don't know is if they are complete. I don't know why I can't receive and send audio. This is connecting to Janus, but not sending data or receiving. Do you have a clue? – moigamijunior Sep 28 '21 at 12:20

1 Answers1

0

This is what I got:

    gst.CreatePipeline("opus", []*webrtc.TrackLocalStaticSample{opusTrack}, "autoaudiosrc").Start()

"autoaudiosrc" is the matter.

Linux Ubuntu Server 21.04.4

moigamijunior
  • 85
  • 1
  • 7