private void StartProtocol()
    {
        if (!shouldEnable())
        {
            return;
        }

        microphoneManager = GetComponent <MicrophoneManager>();

        AnimatedText dialogScreenAnimatedText = dialogScreen.AddComponent <AnimatedText>() as AnimatedText;

        dialogScreenAnimatedText.textToSpeech = sceneManager.GetComponent <TextToSpeech>();
        dialogScreenAnimatedText.strings      = new string[] {
            "Now you will perform exercises which will help you form and maintain a loving relationship with your inner-child.",
            "Now you feel better connected with your inner-child...",
            "It is important you love your inner-child and vow to comfort it during its times of need.",
            "To show your love for your inner-child, think of one of your favourite songs from your childhood (e.g. a love song)",
            "Nicely done!!! Your song has made the inner-child feel more loved",
            "Now let's move on to more activities to increase the bond you have with your inner-child.",
            "Giving yourself a massage is a great way to relieve stress and relax. You can massage any part of your body including your arms, neck and face.",
            "Excellent!!! Your efforts have made your inner-child feel more loved and connected with you",
            "Now let's revisit our soothing song... we can sing this song when we are in times of stress to remind us of the importance of comforting our inner-child. Slowly moving our body to the rhytm also helps with this exercise.",
            "Hence we must practice comfortably and intutively singing this song often to remind you of your connection to your inner-child and help you feel the happiness associated with the song",
            "Excellent!!!, your song has made your inner-child much happier",
            "It is very important that you remember to sing this song whenever you feel distressed. It will remind you of your loving bond with your inner-child who you want to feel the happiness associated with song.",
            "Practice singing to your inner-child until the action becomes intuitive and natural. Now to complete this stage... We must practice reciting important phrases to our inner-child.",
            "Excellent!!! continue to practice these activities continuously so you can use them to improve your mood in connection with your inner-child."
        };
        dialogScreenAnimatedText.enabled = true;

        child.SendMessage("DeactiveEmoScreen");
        child.SendMessage("SetNeutralEmotion");
        dialogScreen.SetActive(true);
    }
示例#2
0
        private void load(KaraokeRulesetConfigManager config, IBindable <IReadOnlyList <Mod> > mods, IBindable <WorkingBeatmap> beatmap, EditorBeatmap editorBeatmap)
        {
            if (editorBeatmap != null)
            {
                return;
            }

            this.beatmap = beatmap.Value.Beatmap;

            var disableMicrophoneDeviceByMod = mods.Value.OfType <IApplicableToMicrophone>().Any(x => !x.MicrophoneEnabled);

            if (disableMicrophoneDeviceByMod)
            {
                return;
            }

            var beatmapSaitenable = beatmap.Value.Beatmap.IsScorable();

            if (!beatmapSaitenable)
            {
                return;
            }

            var selectedDevice = config.GetBindable <string>(KaraokeRulesetSetting.MicrophoneDevice).Value;
            var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList();

            // Find index by selection id
            var deviceIndex = microphoneList.IndexOf(selectedDevice);

            AddHandler(new OsuTKMicrophoneHandler(deviceIndex));
        }
示例#3
0
 private void Awake()
 {
     dialogMgr         = GetComponent <MyDialogMgr>();
     speechManager     = GetComponent <SpeechManager>();
     microphoneManager = GetComponent <MicrophoneManager>();
     instance          = this;
 }
 private void Update()
 {
     if (mPlayStatus == PlayStatus.Playing)
     {
         UpdateTvTime(MicrophoneManager.GetInstance().mPlayingTime.ToString());
     }
 }
示例#5
0
    /// <summary>
    /// Obtiene el valor medio cuadrático de 1024 muestras obtenidas en el instante.
    /// Con ese valor, calcula el valor en decibelios de la muestra.
    /// </summary>
    /// <returns>Valor en decibelios del micrófono.</returns>
    float getLoudness()
    {
        float[] waveData    = new float[_sampleWindow];
        int     micPosition = MicrophoneManager.GetMicrophonePosition() - (_sampleWindow + 1); // null means the first microphone

        if (micPosition < 0)
        {
            return(0);
        }
        MicrophoneManager.AudioClip.GetData(waveData, micPosition);

        //Normalize(waveData);

        //Root Mean Square value calculation
        float rmsvalue = 0.0f;

        for (int i = 0; i < _sampleWindow; i++)
        {
            rmsvalue += waveData[i] * waveData[i];
        }
        rmsvalue = Mathf.Sqrt(rmsvalue / _sampleWindow);

        float decibels = 20 * Mathf.Log10(rmsvalue / 0.01f);

        return(rmsvalue);
    }
示例#6
0
 void Awake()
 {
     microphoneManager = FindObjectOfType <MicrophoneManager>();
     audioSource       = GetComponent <AudioSource>();
     objPath           = GetComponentInParent <ObjectPath>();
     ScareThemAway     = false;
 }
        public void micInputNotice(ClientResponse response)
        {
            int uuid        = int.Parse(response.message);
            var avatarIndex = _host.Data.toAvatarIndex(uuid);

            _host.UIHelper.getCardGOs(avatarIndex).PlayerItem.showChatAction();
            MicrophoneManager.getInstance().PlaySound(response.bytes);
        }
 public static MicrophoneManager getInstance()
 {
     if (_instance == null)
     {
         _instance = GameManager.getInstance().Stage.AddComponent <MicrophoneManager> ();
     }
     return(_instance);
 }
示例#9
0
    // Use this for initialization
    private void Awake()
    {
        Debug.Log("MicrophoneManager.Awake");

        // allows this class instance to behave like a singleton
        instance = this;

        dictationRecognizer = new DictationRecognizer();
        dictationRecognizer.DictationResult += DictationRecognizer_DictationResult;
        dictationRecognizer.DictationError  += DictationRecognizer_DictationError;
    }
示例#10
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
        public TestSceneGetMicrophoneList()
        {
            var manager = new MicrophoneManager();

            Child = new BasicDropdown <string>
            {
                X     = 100,
                Y     = 100,
                Width = 300,
                Items = manager.MicrophoneDeviceNames
            };
        }
示例#12
0
 void Start()
 {
     speechBubblePos = Camera.main.transform.position;
     //This needs to be scraped from server at some point
     url            = "http://172.25.53.167:8000/sounds.json";
     soundObjects   = new List <GameObject>();
     soundThreshold = 1000;
     bestPosition   = new Vector3(0, 0, 0);
     //These three components are needed to record speech
     dictationAudio      = gameObject.GetComponent <AudioSource>();
     microphoneManager   = GetComponent <MicrophoneManager>();
     dictationAudio.clip = microphoneManager.StartRecording();
 }
 public void OnPointerDown()
 {
     if (getUserList().Count > 0)
     {
         _isRecording = true;
         recordBtn.SetActive(true);
         MicrophoneManager.getInstance().StartRecord();
     }
     else
     {
         TipsManager.getInstance().setTips("房间里只有你一个人,不能发送语音");
     }
 }
 protected override void OnClose()
 {
     if (MicrophoneManager.GetInstance().mRecordStatus.Value == RecordStatus.Recording)
     {
         MicrophoneManager.GetInstance().PauseRecord();
     }
     MicrophoneManager.GetInstance().mRecordStatus.Value = RecordStatus.NoRecord;
     MicrophoneManager.GetInstance().mPlayStatus.Value = PlayStatus.NoPlaying;
     MicrophoneManager.GetInstance().Destory();
     if (mResLoader.IsNotNull())
     {
         mResLoader.Recycle2Cache();
         mResLoader = null;
     }
 }
        void StartRequestForPunch(string filePath)
        {
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("babyId", PlayerPrefsUtil.GetBabyId());
            paramDict.Add("relBoxId", mData.BoxId);
            paramDict.Add("boxDay", mData.BoxDay);
            if (mData.Action == AttendanceAdd.Audio)
            {
                paramDict.Add("duration", (int)(MicrophoneManager.GetInstance().GetClipLength() * 1000));
            }
            paramDict.Add("punchText", InputContent.text);
            paramDict.Add("punchType", (int)mData.Action);
            paramDict.Add("punchPath", filePath);
            HttpUtil.PostWithSign <AttendanceModel>(UrlConst.Punch, paramDict)
            .Subscribe(response =>
            {
                LoadingManager.GetInstance().DismissLoading();
                if (PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.IsNull())
                {
                    PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList = new List <int>();
                }
                if (PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList
                    .Contains(mData.BoxDay))
                {
                    PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.Remove(mData.BoxDay);
                }
                PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.Add(mData.BoxDay);
                Log.I("发布:" + mData.Action);
                BtnPush.enabled = true;
                SimpleEventSystem.Publish(new AttendanceSuccess(true));
                UIMgr.OpenPanel <AttendanceSharePanel>(new AttendanceSharePanelData()
                {
                    AttendanceModel = response
                }, UITransitionType.CIRCLE);
                Close();
            }
                       , e =>
            {
                BtnPush.enabled = true;
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                }
            }).AddTo(this);
        }
示例#16
0
    void Start()
    {
        dictationAudio = gameObject.GetComponent <AudioSource>();

        startAudio = gameObject.AddComponent <AudioSource>();
        stopAudio  = gameObject.AddComponent <AudioSource>();

        startAudio.playOnAwake = false;
        startAudio.clip        = StartListeningSound;
        stopAudio.playOnAwake  = false;
        stopAudio.clip         = StopListeningSound;

        microphoneManager = GetComponent <MicrophoneManager>();

        origLocalScale  = Waveform.localScale.y;
        animateWaveform = false;
    }
示例#17
0
        public void init(UIStage uiStage, GameObject root, GameObject login)
        {
            this.uiStage = uiStage;
            this.stage   = uiStage.gameObject;
            this.root    = root;
            wechatAPI    = stage.GetComponent <WechatHelper>();

            TipsManager.getInstance().init(stage.transform);
            SceneManager.getInstance().init(root.transform, login);

            MicrophoneManager.getInstance().init();

            SoundManager.getInstance();             //TODO 后面改

            updateHelper = new UpdateHelper();
            this.uiStage.StartCoroutine(updateHelper.updateCheck());
        }
示例#18
0
    private void StartProtocol()
    {
        if (!shouldEnable())
        {
            return;
        }

        microphoneManager = GetComponent <MicrophoneManager>();

        AnimatedText dialogScreenAnimatedText = dialogScreen.AddComponent <AnimatedText>() as AnimatedText;

        dialogScreenAnimatedText.textToSpeech = sceneManager.GetComponent <TextToSpeech>();
        dialogScreenAnimatedText.strings      = new string[] {
            "Through the previous stages we have learnt exercises to strengthen our attachment to our inner-child.",
            "Using the bond you have developed with your child, these exercises can be used to calm your inner-child's emotional state when you experience trauma due to past events.",
            "For the first protocol, we need to imagine a traumatic experience from our past that has caused us to feel emotions associated with terror, helplessness, humiliation or rage.",
            "These negative emotions make your inner-child distressed... during these times our adult-self must quickly comfort and embrace the inner-child to make them happy again.",
            "Great, Your embrace has improved the emotional state of the inner-child.",
            "Now it is also important that we tell our inner-child with a loud voice supportive and reassuring phrases to help ease the pain of the traumatic experiences.",
            "Great! By continuing to rehearse this protocol you will be better able to self-regulate your emotions when you inner-child feels distressed",

            "Now we will move on to analyse a special image called the Gesalt vase which is a black vase that is associated with powerful dark and negative emotions.",
            "Look next to the inner-child at the Gesalt vase...",
            "However, the positive loving bond you have created with the inner-child using the previous protocols can be used to help overcome the negative emotions associated witht he vase. This can be done through singing your happy song for example.",
            "Excellent! Using the exercises learnt is a great way to relieve the stress caused by these dark emotions.",
            "Once this is achieved, we can disassociate the dark emotions from the image and start to see new possibilities...",
            "Look at the new red outline, you should be able to make out two white faces!",
            "These white faces represent our adult-self and inner-child looking at each other in a loving relationship",
            "We tend to see things from different perspectives depending on our emotions",

            "Finally, through performing these protocols to increase positive affects and contain the inner-child's negative thoughts and emotions...",
            "we start to realise these feelings stem from our negative past experiences e.g. toxic parental relationships.",
            "But as you continue to reduce these negative emotions, you and your inner-child can sense the growth in your emotional maturity and you no longer...",
            "have to see yourself as a scared prisoner of your past. You can now rely on your loving relationship with your inner-child to escape your struggles.",
            "Your cooperation with your inner child can be represented as a new and beautiful house with beautiful scenery...",
            "We can use the HoloLens to make this scenery a reality...",
            "Now look around your enhanced augmented environment!",
            "The chandelier has brighten up your room! The light and the beautiful new scenery is based on your new secure attachment with your inner child",
            "As your bond with your inner-child increases... think of this bright scenery to help remind you of your attachment."
        };
        dialogScreenAnimatedText.enabled = true;

        child.SendMessage("DeactiveEmoScreen");
        child.SendMessage("SetSadEmotion");
        dialogScreen.SetActive(true);
    }
示例#19
0
 /// <summary>
 /// Resets the microphone if conditions require it to be reset
 /// </summary>
 private void resetMicrophone()
 {
     if (microphoneManager != null)
     {
         if (microphoneManager.speechText.GetComponent <TextMesh>().text.Equals("Speech has ended."))
         {
             microphoneManager   = GetComponent <MicrophoneManager>();
             dictationAudio.clip = microphoneManager.StartRecording();
         }
     }
     else
     {
         dictationAudio      = gameObject.GetComponent <AudioSource>();
         microphoneManager   = GetComponent <MicrophoneManager>();
         dictationAudio.clip = microphoneManager.StartRecording();
     }
 }
示例#20
0
    const int RECORD_RATE = 24000; //录音采样率

    //void Awake()
    //{
    //    m_instance = this;
    //}
    public static MicrophoneManager GetInstance()
    {
        if (m_instance == null)
        {
            micArray = Microphone.devices;
            if (micArray.Length == 0)
            {
                Debug.Log("no mic device");
            }
            foreach (string deviceStr in Microphone.devices)
            {
                Debug.Log("device name = " + deviceStr);
            }
            GameObject micManager = new GameObject("MicManager");
            m_instance = micManager.AddComponent <MicrophoneManager>();
        }
        return(m_instance);
    }
示例#21
0
        private void load(KaraokeRulesetConfigManager config, IBindable <IReadOnlyList <Mod> > mods, IBindable <WorkingBeatmap> beatmap, KaraokeSessionStatics session, EditorBeatmap editorBeatmap)
        {
            if (editorBeatmap != null)
            {
                session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.Edit);
                return;
            }

            this.beatmap = beatmap.Value.Beatmap;

            var disableMicrophoneDeviceByMod = mods.Value.OfType <IApplicableToMicrophone>().Any(x => !x.MicrophoneEnabled);

            if (disableMicrophoneDeviceByMod)
            {
                session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.AutoPlay);
                return;
            }

            var beatmapSaitenable = beatmap.Value.Beatmap.IsScorable();

            if (!beatmapSaitenable)
            {
                session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.NotSaitening);
                return;
            }

            try
            {
                var selectedDevice = config.Get <string>(KaraokeRulesetSetting.MicrophoneDevice);
                var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList();

                // Find index by selection id
                var deviceIndex = microphoneList.IndexOf(selectedDevice);
                AddHandler(new OsuTKMicrophoneHandler(deviceIndex));

                session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.Saitening);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Microphone initialize error.");
                // todo : set real error by exception
                session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.WindowsMicrophonePermissionDeclined);
            }
        }
示例#22
0
    // Use this for initialization
    void Awake()
    {
        microphoneManager = this.GetComponent <MicrophoneManager>();

        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer              = new GestureRecognizer();
        recognizer.TappedEvent += (source, tapCount, ray) =>
        {
            // Send an OnSelect message to the focused object and its ancestors.
            if (FocusedObject != null)
            {
                FocusedObject.SendMessageUpwards("OnSelect");
            }
        };
        recognizer.HoldStartedEvent   += Recognizer_HoldStartedEvent;
        recognizer.HoldCompletedEvent += Recognizer_HoldCompletedEvent;
        recognizer.StartCapturingGestures();
    }
        /// <summary>
        /// Initializes a new thread to be used for constantly listening to the microphone input.
        /// </summary>
        /// <returns>The thread which the microphone listener is running on.</returns>
        protected Thread CreateMicrophoneRecorder()
        {
            //Microphone initialization;
            micManager = new MicrophoneManager();
            micManager.FinishedSampling += OnMicrophoneFinishedSamplingEvent;

            //Crate new thread for constantly listening to the microphone input.
            Thread thread = new Thread(new ThreadStart(() =>
            {
                //Initialize microphone recorder.
                micManager.RecorderInit();
                //Listen constantly, untill a further notice.
                while (shouldListen)
                {
                    micManager.Listen();
                }
            }));

            return(thread);
        }
示例#24
0
    // Use this for initialization
    void Start()
    {
        otherPlayerConnections = new Dictionary <int, string>();
        micMan = gameObject.GetComponent <MicrophoneManager>();
        byte error;

        NetworkTransport.Init();
        ConnectionConfig config = new ConnectionConfig();

        reliable   = config.AddChannel(QosType.Reliable);
        unreliable = config.AddChannel(QosType.Unreliable);
        HostTopology topology = new HostTopology(config, 100);

        hostId   = NetworkTransport.AddHost(topology, port);
        deviceId = SystemInfo.deviceUniqueIdentifier;
        byte[] bytes = Encoding.ASCII.GetBytes(deviceId);
        NetworkTransport.StartBroadcastDiscovery(hostId, port, key, version, subversion, bytes, bytes.Length, broadcastInterval, out error);
        NetworkTransport.SetBroadcastCredentials(hostId, key, version, subversion, out error);
        //Invoke("TestBC", 1);
    }
    void Start()
    {
        // Create Storage Service client with name and access key
        _client = new StorageServiceClient(ACC_NAME, KEY);

        // Create Service from client
        _service = _client.GetBlobService();

        // Create Audio Sources
        voiceInputAudio        = gameObject.GetComponent <AudioSource>();
        startAudio             = gameObject.AddComponent <AudioSource>();
        stopAudio              = gameObject.AddComponent <AudioSource>();
        startAudio.playOnAwake = false;
        startAudio.clip        = StartListeningSound;
        stopAudio.playOnAwake  = false;
        stopAudio.clip         = StopListeningSound;

        // Get Microphone manager
        microphoneManager = GetComponent <MicrophoneManager>();
    }
        /// <summary>
        /// Initializes a new thread to be used for constantly listening to the microphone input.
        /// </summary>
        /// <returns>The thread which the microphone listener is running on.</returns>
        protected Thread CreateMicrophoneRecorder()
        {
            //Microphone initialization;
            micManager = new MicrophoneManager();
            micManager.FinishedSampling += OnMicrophoneFinishedSamplingEvent;

            //Crate new thread for constantly listening to the microphone input.
            Thread thread = new Thread(new ThreadStart(() =>
            {
                //Initialize microphone recorder.
                micManager.RecorderInit();
                //Listen constantly, untill a further notice.
                while (shouldListen)
                {
                    micManager.Listen();
                }
            }));

            return thread;
        }
示例#27
0
    void Start()
    {
        dictationAudio = gameObject.GetComponent <AudioSource>();

        startAudio = gameObject.AddComponent <AudioSource>();
        stopAudio  = gameObject.AddComponent <AudioSource>();

        startAudio.playOnAwake = false;
        startAudio.clip        = StartListeningSound;
        stopAudio.playOnAwake  = false;
        stopAudio.clip         = StopListeningSound;

        microphoneManager = GetComponent <MicrophoneManager>();

        origLocalScale  = Waveform.localScale.y;
        animateWaveform = false;

        // TODO: 2.a Delete the following two lines:
        RecordButton.SetActive(false);
        MessageUIRenderer.gameObject.SetActive(false);
    }
 private void Update()
 {
     if (TvTime.IsActive())
     {
         TvTime.text = StringUtil.SecondsToMinutes((int)MicrophoneManager.GetInstance().mRecordTime);
         if ((int)MicrophoneManager.GetInstance().mRecordTime == (MicrophoneManager.RECORD_TIME - 1))
         {
             if (MicrophoneManager.GetInstance().mRecordStatus.Value != RecordStatus.RecordComplete)
             {
                 MicrophoneManager.GetInstance().StopRecord();
             }
         }
         else if (((int)MicrophoneManager.GetInstance().mRecordTime) >= (MicrophoneManager.RECORD_TIME - 1 - 10))
         {
             string time = "<color=#FF9E47>" + (MicrophoneManager.RECORD_TIME - 1 - (int)MicrophoneManager.GetInstance().mRecordTime) + "s </color>";
             TvRecord.text = "录制中...\n" + time + " 结束录音";
         }
         else
         {
             TvRecord.text = "录制中...\n点击完成结束录音";
         }
     }
 }
示例#29
0
    void Start()
    {
        FlikittCore = GameObject.Find("Flikitt Core").GetComponent <FlikittCore>();
        //CameraManager = GameObject.Find("Camera Manager").GetComponent<CameraManager>();
        MicrophoneManager = GameObject.Find("Microphone Manager").GetComponent <MicrophoneManager>();
        DrawingManager    = GameObject.Find("Drawing Manager").GetComponent <DrawingManager>();
        SaveLoad          = GameObject.Find("Easy Save 3 Manager").GetComponent <SaveLoad>();
        ShareManager      = GameObject.Find("Share Manager").GetComponent <ShareManager>();


        fpsSlider.maxValue = 60.0f; fpsSlider.minValue = 0.5f;

        string[] colors = new string[9] {
            "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Purple", "White", "Black"
        };
        for (int i = 0; i < colors.Length; i++)
        {
            Image       swatchImage = GameObject.Find(colors[i] + "_Swatch").GetComponent <Image>();
            ColorSwatch colorSwatch = new ColorSwatch(colors[i], swatchImage);
            colorSwatches.Add((new ColorSwatch(colors[i], swatchImage)));
        }
        DisableAllSwatches();
        EnableSwatch("White");

        SetMode("Capture");

        copyLength1.color = new Color(copyLength1.color.r, copyLength1.color.g, copyLength1.color.b, 1.0f);
        fadeIn.color      = new Color(fadeIn.color.r, fadeIn.color.g, fadeIn.color.b, 1.0f);

        foreach (var obj in Resources.FindObjectsOfTypeAll <Transform>() as Transform[])
        {
            if (obj.gameObject.name == "Saving Dock" || obj.gameObject.name == "Save Text")
            {
                obj.gameObject.SetActive(false);
            }
        }
    }
示例#30
0
    void Start()
    {
        RecordButton     = RecordButtonObject.GetComponent <Button>();
        RecordStopButton = RecordStopButtonObject.GetComponent <Button>();
        PlayButton       = PlayButtonObject.GetComponent <Button>();
        PlayStopButton   = PlayStopButtonObject.GetComponent <Button>();

        dictationAudio = gameObject.GetComponent <AudioSource>();

        startAudio = gameObject.AddComponent <AudioSource>();
        stopAudio  = gameObject.AddComponent <AudioSource>();

        startAudio.playOnAwake = false;
        startAudio.clip        = StartListeningSound;
        stopAudio.playOnAwake  = false;
        stopAudio.clip         = StopListeningSound;

        microphoneManager = GetComponent <MicrophoneManager>();

        LUISController = GameObject.Find("LUISManager").GetComponent <AutoLUISManager>();

        //origLocalScale = Waveform.localScale.y;
        //animateWaveform = false;
    }
示例#31
0
        public MicrophoneDevicePreview()
        {
            ShowBackground = false;
            bindableMicrophoneDeviceName.BindValueChanged(x =>
            {
                // Find index by selection id
                var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList();
                var deviceName     = x.NewValue;
                var deviceIndex    = microphoneList.IndexOf(x.NewValue);
                var hasDevice      = !string.IsNullOrEmpty(x.NewValue);

                Child = new MicrophoneInputManager(deviceIndex)
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new MicrophoneSoundVisualizer
                    {
                        Anchor     = Anchor.Centre,
                        Origin     = Anchor.Centre,
                        DeviceName = deviceName,
                        HasDevice  = hasDevice,
                    }
                };
            }, true);
        }