protected override void OnAudioDataEncoded(VoicePacketWrapper encodedFrame) { VoipMessage message = new VoipMessage(); message.data = encodedFrame.RawData; message.headers = encodedFrame.ObtainHeaders(); tranceiver.SendVoipFrame(encodedFrame); }
private void onVoipMessage(NetworkMessage netMsg) { VoipMessage voipMsg = netMsg.ReadMessage <VoipMessage>(); foreach (MessageNode node in messageNodes) { node.OnVoipMessage(voipMsg); } }
public static void ProcessMessage(Game game, byte[] buffer, long offset, long size) { var msg = new VoipMessage(buffer, offset); var src = msg.Source; game.Output.SetOutputs(msg.Source, msg.Listeners); lock (game.InputStream[src]) game.InputStream[src].AddSamples(msg.FloatAudio()); }
public void OnVoipMessage(VoipMessage message) { foreach (VoipListener listener in voipListeners) { if (listener != null) { listener.OnVoipMessage(message); } } }
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(); }
public void OnVoipMessage(VoipMessage message) { // Check if I am indeed the origin (end-to-end communication only) if (message.originID == this.netId.Value) { var encodedFrame = new VoicePacketWrapper(message.headers, message.data); //Debug.Log(encodedFrame.Index); foreach (Listener listener in listeners) { listener(encodedFrame); } } }
public static void ReceiveDataAvailable(VoipMessage voipMessage) { var audio = voipMessage.FloatAudio(); receiver.AddSamples(audio.Item1, (int)audio.Item2, (int)audio.Item3, voipMessage.Listeners); }