/// <summary> /// Event handler for receiving an RTP frmae from the remote end of the VoIP call. /// </summary> /// <param name="rtpFrame">The RTP frame received.</param> private void RTPChannelSampleReceived(RTPFrame rtpFrame) { if (rtpFrame != null) { var framePayload = rtpFrame.GetFramePayload(); if (framePayload != null) { for (int index = 0; index < framePayload.Length; index++) { short pcm = MuLawDecoder.MuLawToLinearSample(framePayload[index]); byte[] pcmSample = new byte[] { (byte)(pcm & 0xFF), (byte)(pcm >> 8) }; m_waveProvider.AddSamples(pcmSample, 0, 2); } } } }