remove last packet Rpc

hi.
i use a script for send audio packet for voice chat.
but when i cancel sending ,last packet voice repeat for all clients.
for example i say: "hello every body"
clients hear: hello every body.body.body..... and repeat.
i should remove all packets when cancel sending rpc.how can i do it?

Comments

  • Hi,

    How do you cancel sending? If you just stop calling RPC(...) then nothing special should happen.
    Could you please log RPC calls both on caller and called side to make sure that it's network issue (and not a bug in packet player)
  • for (int i = 0; i < numPackets; i++) {
    								AudioPacket currentPacket = tempAudioPackets [i]; 
    								if (Input.GetKey (KeyCode.T)) 
    								audioView.RPC ("ReceiveAudio", PhotonTargets.Others, currentPacket.position, currentPacket.length, currentPacket.data);
    								VideoChat.audioPackets.Remove (tempAudioPackets [i]);
    						}
    

    .............
    [RPC]
    	void ReceiveAudio( int micPosition, int length, byte[] audioData ) {
    						VideoChat.ToAudio (micPosition, length, audioData);
    				}
    
    its a package(videochat by midnight).
    it records voice in a package and send package.for canceling i just release key!
    if you want ,i can send all codes for you to find problem.
    note:
    in above scripts
    audioView is a component<photonView>
    and
    VideoChat is a dll .
  • No code required.
    Just trace RPC calls with logs as I asked you before.
    I want to make sure that PUN works properly.