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(); } }
/// <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(); } }