Exemplo n.º 1
0
    public void stop()
    {
        if (!running)
        {
            return;
        }

        running = false;

        MainActivity.Instance.VolumeControlStream = Stream.NotificationDefault;

        if (audioPlayer != null)
        {
            try
            {
                audioPlayer.Stop();
                audioPlayer.Release();
            }
            catch (Exception)
            {
            }

            audioPlayer.Dispose();
            audioPlayer = null;
        }

        if (audioDecoder != null)
        {
            audioDecoder.stop();
            audioDecoder.Dispose();
            audioDecoder = null;
        }

        bufferSize = 0;
    }
Exemplo n.º 2
0
    public void stop()
    {
        if (!running)
        {
            return;
        }

        running = false;

        if (audioPlayer != null)
        {
            try
            {
                audioPlayer.Stop();
            }
            catch (Exception)
            {
            }

            audioPlayer.Dispose();
            audioPlayer = null;
        }

        if (audioDecoder != null)
        {
            audioDecoder.stop();
            audioDecoder.Dispose();
            audioDecoder = null;
        }

        if (provider != null)
        {
            provider.ClearBuffer();
        }
    }
Exemplo n.º 3
0
    public void stop()
    {
        if (!running)
        {
            return;
        }

        running = false;

        AVAudioSession.SharedInstance().SetActive(false);

        if (audioPlayer != null)
        {
            try
            {
                audioPlayer.Stop();
                audioPlayer.Reset();
            }
            catch (Exception)
            {
            }

            audioPlayer.Dispose();
            audioPlayer = null;
        }

        if (audioDecoder != null)
        {
            audioDecoder.stop();
            audioDecoder.Dispose();
            audioDecoder = null;
        }

        if (audioEngine != null)
        {
            try
            {
                audioEngine.Stop();
                audioEngine.Reset();
            }
            catch (Exception)
            {
            }

            audioEngine.Dispose();
            audioEngine = null;
        }
    }