protected override void OnAudioDataEncoded(VoicePacketWrapper encodedFrame)
    {
        byte[] headers = encodedFrame.ObtainHeaders();
        GetComponent <PhotonView>().RPC("vc", PhotonTargets.Others, headers, encodedFrame.RawData);
        encodedFrame.ReleaseHeaders();

        lastTalking = DateTime.Now;
    }
Beispiel #2
0
    protected override void OnAudioDataEncoded(VoicePacketWrapper encodedFrame)
    {
        VoipMessage message = new VoipMessage();

        message.data    = encodedFrame.RawData;
        message.headers = encodedFrame.ObtainHeaders();

        tranceiver.SendVoipFrame(encodedFrame);
    }
Beispiel #3
0
        void CmdSendFrame(VoicePacketWrapper encodedFrame)
        {
            VoipMessage message = new VoipMessage();

            message.originID = this.netId.Value;
            message.data     = encodedFrame.RawData;
            message.headers  = encodedFrame.ObtainHeaders();

            NetworkServer.SendToAll(MessageNetworkManager.MSG_VOIP, message);
            encodedFrame.ReleaseHeaders();
        }
    protected override void OnAudioDataEncoded(VoicePacketWrapper encodedFrame)
    {
        byte[] headers = encodedFrame.ObtainHeaders();

        // Option #1: using RPC
        //photonView.RPC("HandleVoice", PhotonTargets.Others, headers, encodedFrame.RawData);

        // Option #2: using events
        byte[][] data = new byte[2][];
        data[0] = headers;
        data[1] = encodedFrame.RawData;
        PhotonNetwork.RaiseEvent(EVENT_VOICE, data, false, eventOptions);
        encodedFrame.ReleaseHeaders();

        lastTalking = DateTime.Now;
    }