示例#1
0
    // Use this for initialization
    void Start()
    {
        if (voiceTranceiver == null)
        {
            Debug.LogError("No VoipTranceiver set.");
            valid = false;
        }
        if (mouthMovement == null)
        {
            Debug.LogError("No MouthMovement set.");
            valid = false;
        }

        voiceTranceiver.addVoipFrameListener(VoipFrameReceived);
    }
示例#2
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
    }