Esempio n. 1
0
        private static int audioFrameUpdateCount = 0;    //Is increased every time, a new audio frame is recognized.

        /// <summary>
        /// Starts the microphone input and trys not to crash the application.
        /// </summary>
        public async static Task StartMicrophoneInputSafely()
        {
            if (!isListing && !isCreating)
            {
                stopOnCreation = false;
                await SoundInput.StartInput();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Stops the microphone input and trys not to crash the application.
        /// </summary>
        public static void StopMicrophoneInputSafely()
        {
            if (isCreating)
            {
                stopOnCreation = true;
            }

            if (isListing && !isCreating)
            {
                _ = SoundInput.StopInput();
            }
        }