private object SetChannel(float result) { var intResult = (int)result; --intResult; if (intResult < 0) { intResult = 0; } else if (intResult >= _currentDevice.ChannelCount) { intResult = _currentDevice.ChannelCount - 1; } _currentChannel = intResult; _audioLevelTracker.channel = _currentChannel; _spectrumAnalyzer.channel = _currentChannel; PlayerPrefHelper.SetCurrentChannel(intResult); _channelData.text = (_currentChannel + 1).ToString(); return(true); }