public static Class16 smethod_2(Stream stream1, TimeSpan timeSpan0, int int3, int int4, bool bool1) { var waveFormat = new WaveFormat(int3, 16, bool1 ? 2 : 1); var stream = new Stream16(stream1, waveFormat, new BeConfig(waveFormat, (uint)int4)); var uint_ = (uint)stream.vmethod_1().Position; var array = new byte[stream.method_0() * 2]; Class16 result; try { var num = 0; var num2 = (int)(timeSpan0.TotalSeconds * waveFormat.int_1); int count; while ((count = Math.Min(num2 - num - array.Length, array.Length)) > 0) { stream.Write(array, 0, count); num += array.Length; } result = new Class16(waveFormat, uint_, (uint)stream.vmethod_1().Length, int4 * 1000); } finally { stream.method_1(); } return(result); }
public static Class16 smethod_0(GenericAudioStream stream10, Stream stream1, int int3, int int4) { var waveFormat = stream10.vmethod_0(); if (waveFormat.waveFormatTag_0 != WaveFormatTag.Pcm || waveFormat.short_2 != 16) { stream10 = new Stream4(stream10, 16); waveFormat = stream10.vmethod_0(); } var stream = new Stream16(stream1, waveFormat, (waveFormat.int_0 == int3) ? new BeConfig(waveFormat, (uint)int4) : new BeConfig(waveFormat, (uint)int4, (uint)int3)); var uint_ = (uint)stream.vmethod_1().Position; var array = new byte[stream.method_0() * 2]; Class16 result; try { int count; while ((count = stream10.Read(array, 0, array.Length)) > 0) { stream.Write(array, 0, count); } result = new Class16(new WaveFormat(int3, waveFormat.short_0), uint_, (uint)stream.vmethod_1().Length, int4 * 1000); } finally { stream.method_1(); } return(result); }