Пример #1
0
    private void Awake()
    {
        Instance    = this;
        unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        activity    = unityPlayer.GetStatic <AndroidJavaObject>("currentActivity");
        //VoiceChatSettings.Instance.Preset = VoiceChatPreset.Alaw_Zlib_16k;

        //voiceChatRecorder = gameObject.AddComponent<VoiceChatRecorder>();

        //voiceChatRecorder.NewSample += packet => { SocketHelper.Instance.SendVoice(packet); };
    }
Пример #2
0
        private void Update()
#endif
        {
            if (Input.GetKeyDown(checkMicrophoneKey))
            {
#if ENABLE_WINMD_SUPPORT
                var status = await MicrophoneHelper.GetMicrophoneStatus();
#else
                var status = MicrophoneHelper.GetMicrophoneStatus();
#endif
                Debug.LogFormat("Microphone status: {0}", status);
            }
        }
Пример #3
0
        //Update is called one per frame
        private void Update()
#endif
        {
            //If the button assigned to checkMicrophoneKey is pressed
            if (Input.GetKeyDown(checkMicrophoneKey))
            {
#if ENABLE_WINMD_SUPPORT
                var status = await MicrophoneHelper.GetMicrophoneStatus();
#else
                //Call to GetMicrophoneStatus() method
                var status = MicrophoneHelper.GetMicrophoneStatus();
#endif
                Debug.LogFormat("Microphone status: {0}", status);
            }
        }