private object SetDeviceId(DeviceDescriptor device) { if (_currentDevice.IsValid == true && device.Name == _currentDevice.Name) { return(false); } PlayerPrefHelper.SetLastSavedDeviceDefault(device.Name); _currentDevice = device; try { _audioLevelTracker.deviceID = device.ID; _spectrumAnalyzer.deviceID = device.ID; if (_currentChannel >= device.ChannelCount) { SetChannel(0); } else { SetChannel(_currentChannel + 1); } } catch (Exception e) { if (e.Message.Contains("Stream")) { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } } _idData.text = device.Name.ToLower(); return(true); }