void Update() { if (Time.time - curTime > 10) { client.SendMessageToAll(Encoding.UTF8.GetBytes("Hi there I'm a client"), true); curTime = Time.time; } client.UpdateClient(); }
private void Update() { isRecording = Input.GetKey(KeyCode.P); client.UpdateClient(); if (client.peers.Count > 0) { while (packets.Count > 0) { float[] curPacket = packets.Dequeue(); ToShortArray(curPacket, outBufferShort); int resLen = speexEnc.Encode(outBufferShort, 0, curPacket.Length, outBuffer, 0, outBuffer.Length); client.SendMessageToAll(outBuffer, 0, resLen, true); } } }
void FixedUpdate() { recorder.Poll(); client.UpdateClient(); }