public void method_0(GenericAudioStream stream1_1) { if (Thread.CurrentThread.ManagedThreadId != this.thread_0.ManagedThreadId) { lock (this.queue_1) { this.queue_1.Enqueue(new WaveOutput.Class164(WaveOutput.Enum19.const_0, this.stream1_0)); this.autoResetEvent_0.Set(); } return; } this.stream1_0 = stream1_1; this.int_0 = stream1_1.vmethod_0().method_0(this.int_2 / 5); Exception4.smethod_1(Class162.waveOutOpen(out this.intptr_0, this.int_1, this.stream1_0.vmethod_0(), this.delegate4_0, 0, Class162.Enum17.const_3), "waveOutOpen"); this.stream1_0.Position = (long)this.vmethod_0(); this.class158_0 = new Class158[5]; for (int i = 0; i < 5; i++) { this.class158_0[i] = new Class158(this.intptr_0, this.int_0, this.stream1_0, this.object_0); } this.bool_0 = false; }
public AudioPlayer(int int_0, WaveFormat waveFormat_0, int int_1, float Volume, bool bool_3, Delegate3 delegate3_1) : base() { WaitCallback waitCallback = null; AudioPlayer.VolumeListener volumeListener = new AudioPlayer.VolumeListener(); volumeListener.Volume = Volume; this.delegate4_0 = new Class162.Delegate4(Class165.smethod_0); this.object_0 = new object(); //base..ctor(); volumeListener.audioPlayer = 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.SetVolume(0f); this.thread_0.Start(); if (waitCallback == null) { waitCallback = new WaitCallback(volumeListener.StartListener); } ThreadPool.QueueUserWorkItem(waitCallback); }