當前位置: 首頁>>代碼示例>>C#>>正文


C# WaveFormat.Equals方法代碼示例

本文整理匯總了C#中NAudio.Wave.WaveFormat.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# WaveFormat.Equals方法的具體用法?C# WaveFormat.Equals怎麽用?C# WaveFormat.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NAudio.Wave.WaveFormat的用法示例。


在下文中一共展示了WaveFormat.Equals方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AudioRecorder

        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;
            }
        }
開發者ID:JoeGilkey,項目名稱:RadioLog,代碼行數:35,代碼來源:AudioRecorder.cs

示例2: ProcessorWaveProvider

        public ProcessorWaveProvider(string sourceName, IWaveProvider sourceWaveProvider, string waveFilePath, WaveFormat outFormat, Common.ProcessRadioSignalingItemDelegate sigDelegate, Action<bool> hasPropertyChanged, bool recordEnabled, Common.SignalRecordingType recordType, int recordKickTime, Common.NoiseFloor noiseFloor, int customNoiseFloor,bool removeNoise, bool decodeMDC1200, bool decodeGEStar, bool decodeFleetSync, bool decodeP25)
            : base(sourceWaveProvider, waveFilePath)
        {
            LastValidStreamTitle = string.Empty;
            _sourceName = sourceName;
            _sourceFormat = sourceWaveProvider.WaveFormat;
            _outFormat = outFormat;
            _hasPropertyChanged = hasPropertyChanged;

            _silenceHelper = new SilenceHelper(outFormat.AverageBytesPerSecond / (outFormat.BitsPerSample / 8), noiseFloor, removeNoise, customNoiseFloor);

            if (outFormat.Equals(sourceWaveProvider.WaveFormat))
            {
                _resampleStream = null;
                _useResampler = false;
            }
            else
            {
                if (Common.AppSettings.Instance.DiagnosticMode)
                {
                    Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "{0}: Source Format <> Out Format [{1}] <> [{2}]", sourceName, sourceWaveProvider.WaveFormat, outFormat);
                }
                _resampleStream = new NAudio.Wave.Compression.AcmStream(sourceWaveProvider.WaveFormat, outFormat);
                _useResampler = true;
            }
            if (decodeMDC1200)
            {
                _mdc = new Decoders.MDC1200(outFormat.SampleRate, ProcessMDC1200, sourceName);
            }
            else
            {
                _mdc = null;
            }
            if (decodeGEStar)
            {
                _star = new Decoders.STAR(outFormat.SampleRate, ProcessSTAR, Decoders.STAR.star_format.star_format_1_16383, sourceName);
            }
            else
            {
                _star = null;
            }
            _rootDecoder = new Decoders.RootDecoder(outFormat.SampleRate, decodeFleetSync, decodeP25, ProcessRootDecoder);

            _recorder = new AudioRecorder(sourceName, recordType, recordKickTime, outFormat, AudioProcessingGlobals.DefaultSaveFileWaveFormat, recordEnabled);
            _bytesPerSample = outFormat.BitsPerSample / 8;
            _encoding = outFormat.Encoding;
            _sigDelegate = sigDelegate;
        }
開發者ID:JoeGilkey,項目名稱:RadioLog,代碼行數:48,代碼來源:ProcessorWaveProvider.cs


注:本文中的NAudio.Wave.WaveFormat.Equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。