void ProxyInitialize() { ByteDataTunnel tunnel = this.GetComponent <ByteDataTunnel>(); NSpeexAudioProcessor nSpeexProcessor = this.GetComponent <NSpeexAudioProcessor>(); AudioDataReconstructor audioReconstructor = this.GetComponent <AudioDataReconstructor>(); tunnel.DataReceived += nSpeexProcessor.DecodeData; audioReconstructor.DataSource = nSpeexProcessor; }
public void NotifyOwnership() { this.owner = Network.player; ByteDataTunnel tunnel = this.GetComponent <ByteDataTunnel>(); NSpeexAudioProcessor nSpeexProcessor = this.GetComponent <NSpeexAudioProcessor>(); tunnel.RemoteTargets = new System.Collections.Generic.List <NetworkPlayer>() { Network.connections[0] }; Debug.Log("I am the owner of " + this.gameObject.name + ", enabling the microphone collection for that audio tunnel."); UnityMicrophoneDataCollector microphone = this.gameObject.AddComponent <UnityMicrophoneDataCollector>(); microphone.AudioDataReceived += nSpeexProcessor.EncodeData; nSpeexProcessor.AudioFrameEncoded += tunnel.SendDataToRemote; }