void Awake()
    {
        //Get all required components
        Identity = GetComponent <INetworkIdentity>();
        Receiver = GetComponent <IVoiceReceiver>();
        Recorder = GetComponent <IVoiceRecorder>();

        //Compatibility check between self, receiver and recorder
        AudioDataTypeFlag res = Receiver.AvailableTypes & Recorder.AvailableTypes & SelfFlag;

        if (res == AudioDataTypeFlag.None)
        {
            throw new ArgumentException("The given handler type is incompatible with its underlying receiver and recorder components");
        }

        //Set the compatibility value of this handler
        AvailableTypes = res;

        if (IsRecorder)
        {
            Manager.Settings.PushToTalkChanged += OnPushToTalkChanged;
        }
    }
Exemplo n.º 2
0
 public void Awake()
 {
     this.voiceRecorder = new VoiceRecorderAndroidInterface();
     this.voiceRecorder.Init(base.name);
     this.voiceDirectoryName = Application.persistentDataPath + "/VoiceRecord";
 }