Example #1
0
        public override bool Equals(object obj)
        {
            WaveFormat waveFormat = obj as WaveFormat;

            return(waveFormat != null && (this.waveFormatTag == waveFormat.waveFormatTag && this.channels == waveFormat.channels && this.sampleRate == waveFormat.sampleRate && this.averageBytesPerSecond == waveFormat.averageBytesPerSecond && this.blockAlign == waveFormat.blockAlign) && this.bitsPerSample == waveFormat.bitsPerSample);
        }
Example #2
0
        private static long BytesToNsPosition(int bytes, WaveFormat waveFormat)
        {
            long nsPosition = (10000000L * bytes) / waveFormat.AverageBytesPerSecond;

            return(nsPosition);
        }
Example #3
0
 public static WaveFormat CreateMuLawFormat(int sampleRate, int channels)
 {
     return(WaveFormat.CreateCustomFormat(WaveFormatEncoding.MuLaw, sampleRate, channels, sampleRate * channels, channels, 8));
 }
Example #4
0
 public SilenceProvider(WaveFormat wf)
 {
     this.WaveFormat = wf;
 }