Exemple #1
0
 public void StopPlaying()
 {
     _thread0.Abort();
     _enum10 = AudioStatus.ShouldStopAudio;
     Class119.alSourceStop(_intptr1);
     _stopwatch0.Reset();
     Class119.smethod_7(_intptr1, _intptr2.Length);
 }
Exemple #2
0
        private void method_1()
        {
            var flag = false;

            while (_enum10 != AudioStatus.ShouldStopAudio && !flag)
            {
                if (_bool0)
                {
                    _bool0 = false;
                    Class119.alSourcef(_intptr1, Enum10.Const4, _float0);
                }
                if (_enum10 != AudioStatus.IsCurrentlyPlayingAudio)
                {
                    var num = 0;
                    int num2;
                    do
                    {
                        Class119.alGetSourcei(_intptr1, Enum11.Const6, out num2);
                        if (num > 50)
                        {
                            Thread.Sleep(1);
                        }
                        else
                        {
                            num++;
                        }
                    } while (num2 == 0);
                    while (num2-- != 0)
                    {
                        var intPtr = Class119.smethod_6(_intptr1);
                        int num3;
                        lock (_stream10)
                        {
                            num3 = _stream10.vmethod_3(_intptr0, _int1);
                        }
                        if (num3 < _int1)
                        {
                            flag = true;
                        }
                        Class119.alBufferData(intPtr, _enum120, _intptr0, num3, _int0);
                        Class119.smethod_5(_intptr1, ref intPtr);
                        _int3 += _int1;
                        _stopwatch0.Reset();
                        _stopwatch0.Start();
                    }
                    int num4;
                    Class119.alGetSourcei(_intptr1, Enum11.Const5, out num4);
                    if (num4 <= 0)
                    {
                        break;
                    }
                    if (Class119.smethod_4(_intptr1, Enum11.Const4) != 4114)
                    {
                        Class119.alSourcePlay(_intptr1);
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            while (Class119.smethod_4(_intptr1, Enum11.Const6) != _int2)
            {
            }
            Stream arg1880 = _stream10;

            _int3            = 0;
            arg1880.Position = 0L;
            _enum10          = AudioStatus.ShouldStopAudio;
            Class119.alSourceStop(_intptr1);
            _stopwatch0.Reset();
            Class119.smethod_7(_intptr1, _intptr2.Length);
        }