Jump to content
  • 0

Can't hear audio on Peer


Tim Davis
 Share

Question

Hello, I have come a long way in my app using Ant media server but have been stuck on this issue for about 8 days now. In my app,  only one peer will handle all the video and audio for all the peers.. One main Source. 

 

I get no sound on the peer, and a very nasty echo (I am listening and monitoring on same computer)

 

Basically please tell me the correct way to have 1 Main Audio Stream, and peers connect and disconnect from it (which will eventually have a mixer and gain controls via web audio api)

 

  1. Create a video stream from a Video, but it does not have an audio stream  yet..
  2. createMedaStreamDestination as the audio stream for the video stream above.
  3. Add MediaStreamDestination track from #2 to Video Stream from #1

  4. InitWebRTCAdaptor with Video & Audio Streams above
  5. GetUserMedia - Connect audio stream to MediaStreamDestination 

var AudioContext = window.AudioContext || window.webkitAudioContext;

        var Context = new AudioContext();   

        var MasterAudioStream = Context.createMediaStreamDestination();

       

        var MasterAudioVideoStream = document.getElementById("theVideo").srcObject; // does not have an audio stream

        MasterAudioVideoStream.addTrack(MasterAudioStream.stream.getAudioTracks()[0]);

       

       

        // Get ECHOS at this Point

       

        initWebRTCAdaptor(MasterAudioVideoStream);

               

       

        navigator.mediaDevices.getUserMedia({

            video: true, audio: true

        })

        .then(function (UserAudioVideoStream) {   

            var streamSourceNode = Context.createMediaStreamSource(UserAudioVideoStream);

            streamSourceNode.connect(MasterAudioStream);

        }

Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Hi,

From what I understand of your case, you want to send all of the videos and audios to a peer then you want to mix the audio and send it back to the server to publish for the clients. Am I correct?

Well I can help you I guess, however the situation is a little foggy. Can you share your source codes with me, if you don't want to share it in public send it to tahir.golge@antmedia.io please.

Thanks

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...