Exemple #1
0
    protected override void Awake()
    {
        networkIdentity = GetComponent <NetworkIdentity>();
        tranceiver      = GetComponent <VoiceTranceiver>();

        // Listen to VoipTranceiver
        tranceiver.addVoipFrameListener(this.FrameReceived);

        // -- Copied from VoiceControllerBase; removed microphone start
        codec = GetCodec();

        microphone = GetComponent <MicrophoneInputDevice>() as AudioInputDeviceBase;
        speaker    = GetComponent <UnityAudioPlayer>() as IAudioPlayer;
        if (speaker == null)
        {
            Debug.LogError("No AudioSource found.");
        }
        if (microphone == null)
        {
            Debug.LogError("No MicrophoneInputDevice found.");
        }

        // --/ End Copy
    }