本文整理汇总了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;
}
}
示例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;
}