public void Update()
 {
     if (sora != null)
     {
         sora.DispatchEvents();
         sora.OnRender();
         if (clientType == ClientType.Player)
         {
             if (trackId != 0 && receiveTexture != null)
             {
                 sora.RenderTrackToTexture(trackId, receiveTexture);
                 OnVideoTrack.Invoke(receiveTexture);
             }
         }
     }
 }
Exemple #2
0
    IEnumerator Render()
    {
        while (true)
        {
            yield return(new WaitForEndOfFrame());

            if (sora != null)
            {
                sora.OnRender();
            }
            if (sora != null && !Recvonly)
            {
                var samples = AudioRenderer.GetSampleCountForCaptureFrame();
                if (AudioSettings.speakerMode == AudioSpeakerMode.Stereo)
                {
                    using (var buf = new Unity.Collections.NativeArray <float>(samples * 2, Unity.Collections.Allocator.Temp))
                    {
                        AudioRenderer.Render(buf);
                        sora.ProcessAudio(buf.ToArray(), 0, samples);
                    }
                }
            }
        }
    }