NAudio.Wave.WaveFormat.Equals C# (CSharp) Method

Equals() public method

Compares with another WaveFormat object
public Equals ( object obj ) : bool
obj object Object to compare to
return bool
        public override bool Equals(object obj)
        {
            WaveFormat other = obj as WaveFormat;
            if(other != null)
            {
                return waveFormatTag == other.waveFormatTag &&
                    channels == other.channels &&
                    sampleRate == other.sampleRate &&
                    averageBytesPerSecond == other.averageBytesPerSecond &&
                    blockAlign == other.blockAlign &&
                    bitsPerSample == other.bitsPerSample;
            }
            return false;
        }

Usage Example

Example #1
0
        public AudioRecorder(string streamSourceName, Common.SignalRecordingType recordingType, int recordingKickTime, WaveFormat sourceWaveFormat, WaveFormat fileWaveFormat, bool recordingEnabled)
        {
            _recordingType = recordingType;
            switch (_recordingType)
            {
                case SignalRecordingType.Fixed:
                    {
                        RecordingKickTimeTicks = TimeSpan.FromMinutes(recordingKickTime).Ticks;
                        break;
                    }
                default:
                    {
                        RecordingKickTimeTicks = TimeSpan.FromSeconds(recordingKickTime).Ticks;
                        break;
                    }
            }
            RecordingPrefix = RadioSignalLogger.MakeSourceFilePrefix(streamSourceName);
            _sourceWaveFormat = sourceWaveFormat;
            if (fileWaveFormat == null)
                _fileWaveFormat = sourceWaveFormat;
            else
                _fileWaveFormat = fileWaveFormat;
            _recordingEnabled = recordingEnabled;

            if (_sourceWaveFormat.Equals(_fileWaveFormat))
            {
                _resampleStream = null;
                _useResampler = false;
            }
            else
            {
                _resampleStream = new NAudio.Wave.Compression.AcmStream(_sourceWaveFormat, _fileWaveFormat);
                _useResampler = true;
            }
        }
All Usage Examples Of NAudio.Wave.WaveFormat::Equals