Esempio n. 1
0
 public AudioConfig(SerializationInfo serializationInfo_0, StreamingContext streamingContext_0)
 {
     int @int = serializationInfo_0.GetInt32("Format.Rate");
     int int2 = serializationInfo_0.GetInt32("Format.Bits");
     int int3 = serializationInfo_0.GetInt32("Format.Channels");
     this.m_Format = new WaveFormat(@int, int2, int3);
 }
Esempio n. 2
0
 public Class16(WaveFormat waveFormat_1, uint uint_4, uint uint_5)
 {
     this.waveFormat_0 = waveFormat_1;
     this.short_0 = (short)(this.method_1() / this.method_0());
     this.int_0 = (int)this.method_0() * this.method_3() * (int)this.method_2();
     this.uint_0 = Convert.ToUInt32((long)((ulong)uint_5 / (ulong)((long)this.method_1())));
     this.timeSpan_0 = TimeSpan.FromSeconds(this.uint_0 / (double)this.method_3());
     this.uint_1 = uint_4;
     this.uint_3 = uint_5 - this.uint_1;
     this.uint_2 = 0u;
 }
Esempio n. 3
0
 public Class16(WaveFormat waveFormat_1, uint uint_4, uint uint_5, int int_1)
 {
     this.waveFormat_0 = waveFormat_1;
     this.short_0 = (short)(this.method_1() / this.method_0());
     this.int_0 = int_1;
     this.timeSpan_0 = TimeSpan.FromSeconds((uint_5 - uint_4) / ((double)int_1 / 8.0));
     this.uint_0 = Convert.ToUInt32((double)this.method_3() * this.timeSpan_0.TotalSeconds);
     this.uint_1 = uint_4;
     this.uint_3 = this.uint_0 * (uint)this.method_1();
     this.uint_2 = uint_5 - this.uint_1;
 }
Esempio n. 4
0
 private static Microsoft.DirectX.DirectSound.WaveFormat smethod_0(SharpAudio.ASC.WaveFormat waveFormat_0)
 {
     return(new Microsoft.DirectX.DirectSound.WaveFormat
     {
         AverageBytesPerSecond = waveFormat_0.int_1,
         BitsPerSample = waveFormat_0.short_2,
         BlockAlign = waveFormat_0.short_1,
         Channels = waveFormat_0.short_0,
         FormatTag = (Microsoft.DirectX.DirectSound.WaveFormatTag)waveFormat_0.waveFormatTag_0,
         SamplesPerSecond = waveFormat_0.int_0
     });
 }
Esempio n. 5
0
 public Stream16(Stream stream_1, WaveFormat waveFormat_1, BE_CONFIG be_CONFIG_1)
     : base(stream_1, waveFormat_1)
 {
     try
     {
         this.be_CONFIG_0 = be_CONFIG_1;
         uint num = LameEncoder.beInitStream(this.be_CONFIG_0, ref this.uint_1, ref this.uint_2, ref this.uint_0);
         if (num != 0u)
         {
             throw new ApplicationException(string.Format("Lame_encDll.beInitStream failed with the error code {0}", num));
         }
         this.byte_0 = new byte[this.uint_1 * 2u];
         this.byte_1 = new byte[this.uint_2];
     }
     catch
     {
         base.Close();
         throw;
     }
 }
Esempio n. 6
0
 public Class159(int int_0, WaveFormat waveFormat_0, int int_1, float float_0, bool bool_3, Delegate3 delegate3_1)
     : base()
 {
     WaitCallback waitCallback = null;
     Class159.Class160 @class = new Class159.Class160();
     @class.float_0 = float_0;
     this.delegate4_0 = new Class162.Delegate4(Class165.smethod_0);
     this.object_0 = new object();
     //base..ctor();
     @class.class159_0 = this;
     this.bool_2 = bool_3;
     this.byte_0 = (byte)((waveFormat_0.short_2 == 8) ? 128 : 0);
     this.delegate3_0 = delegate3_1;
     Exception4.smethod_1(Class162.waveOutOpen(out this.intptr_0, int_0, waveFormat_0, this.delegate4_0, 0, Class162.Enum17.const_3), "waveOutOpen");
     this.method_7(waveFormat_0.method_0(int_1 / 5), 5);
     this.thread_0 = new Thread(new ThreadStart(this.method_6));
     this.method_2(0f);
     this.thread_0.Start();
     if (waitCallback == null)
     {
         waitCallback = new WaitCallback(@class.method_0);
     }
     ThreadPool.QueueUserWorkItem(waitCallback);
 }
Esempio n. 7
0
 public static Enum12 smethod_10(WaveFormat waveFormat_0)
 {
     switch (waveFormat_0.waveFormatTag_0)
     {
     case WaveFormatTag.PCM:
         switch (waveFormat_0.short_0)
         {
         case 1:
         {
             short short_ = waveFormat_0.short_2;
             if (short_ == 8)
             {
                 return Enum12.const_0;
             }
             if (short_ == 16)
             {
                 return Enum12.const_1;
             }
             break;
         }
         case 2:
         {
             short short_2 = waveFormat_0.short_2;
             if (short_2 == 8)
             {
                 return Enum12.const_2;
             }
             if (short_2 == 16)
             {
                 return Enum12.const_3;
             }
             break;
         }
         default:
             if (Class119.smethod_1())
             {
                 switch (waveFormat_0.short_0)
                 {
                 case 4:
                 {
                     short short_3 = waveFormat_0.short_2;
                     if (short_3 == 8)
                     {
                         return Enum12.const_6;
                     }
                     if (short_3 == 16)
                     {
                         return Enum12.const_7;
                     }
                     if (short_3 == 32)
                     {
                         return Enum12.const_8;
                     }
                     break;
                 }
                 case 5:
                 {
                     short short_4 = waveFormat_0.short_2;
                     if (short_4 == 8)
                     {
                         return Enum12.const_9;
                     }
                     if (short_4 == 16)
                     {
                         return Enum12.const_10;
                     }
                     if (short_4 == 32)
                     {
                         return Enum12.const_11;
                     }
                     break;
                 }
                 case 6:
                 {
                     short short_5 = waveFormat_0.short_2;
                     if (short_5 == 8)
                     {
                         return Enum12.const_12;
                     }
                     if (short_5 == 16)
                     {
                         return Enum12.const_13;
                     }
                     if (short_5 == 32)
                     {
                         return Enum12.const_14;
                     }
                     break;
                 }
                 case 7:
                 {
                     short short_6 = waveFormat_0.short_2;
                     if (short_6 == 8)
                     {
                         return Enum12.const_15;
                     }
                     if (short_6 == 16)
                     {
                         return Enum12.const_16;
                     }
                     if (short_6 == 32)
                     {
                         return Enum12.const_17;
                     }
                     break;
                 }
                 case 8:
                 {
                     short short_7 = waveFormat_0.short_2;
                     if (short_7 == 8)
                     {
                         return Enum12.const_18;
                     }
                     if (short_7 == 16)
                     {
                         return Enum12.const_19;
                     }
                     if (short_7 == 32)
                     {
                         return Enum12.const_20;
                     }
                     break;
                 }
                 }
             }
             break;
         }
         break;
     case WaveFormatTag.IEEEFloat:
         if (Class119.smethod_0())
         {
             switch (waveFormat_0.short_0)
             {
             case 1:
                 return Enum12.const_4;
             case 2:
                 return Enum12.const_5;
             }
         }
         break;
     }
     throw new NotSupportedException(string.Concat(new object[]
     {
         "OpenAL does not support this format: ",
         waveFormat_0.waveFormatTag_0,
         " | ",
         (int)waveFormat_0.waveFormatTag_0
     }));
 }
Esempio n. 8
0
 public AudioConfig(WaveFormat waveFormat_0)
 {
     this.m_Format = new WaveFormat(waveFormat_0.int_0, (int)waveFormat_0.short_2, (int)waveFormat_0.short_0);
 }
Esempio n. 9
0
 public Stream15(Stream stream_1, WaveFormat waveFormat_1)
 {
     this.stream_0 = stream_1;
     this.waveFormat_0 = waveFormat_1;
 }
Esempio n. 10
0
 public static extern Enum18 waveOutOpen(out IntPtr hWaveOut, int uDeviceID, WaveFormat lpFormat, Class162.Delegate4 dwCallback, int dwInstance, Class162.Enum17 dwFlags);
Esempio n. 11
0
 public Stream5(Stream stream_1, WaveFormat waveFormat_1)
 {
     this.fileStream = stream_1;
     this.waveFormat_0 = waveFormat_1;
 }
Esempio n. 12
0
 public static Class16 smethod_2(Stream stream_1, TimeSpan timeSpan_0, int int_3, int int_4, bool bool_1)
 {
     WaveFormat waveFormat = new WaveFormat(int_3, 16, bool_1 ? 2 : 1);
     Stream16 stream = new Stream16(stream_1, waveFormat, new BE_CONFIG(waveFormat, (uint)int_4));
     uint uint_ = (uint)stream.vmethod_1().Position;
     byte[] array = new byte[stream.method_0() * 2];
     Class16 result;
     try
     {
         int num = 0;
         int num2 = (int)(timeSpan_0.TotalSeconds * (double)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, int_4 * 1000);
     }
     finally
     {
         stream.method_1();
     }
     return result;
 }
Esempio n. 13
0
 public static IntPtr smethod_1(WaveFormat waveFormat_0)
 {
     int cb = Marshal.SizeOf(waveFormat_0);
     IntPtr intPtr = Marshal.AllocHGlobal(cb);
     Marshal.StructureToPtr(waveFormat_0, intPtr, false);
     return intPtr;
 }