public void Stop() { if (IsPlaying) { ForceStop = true; PlayerNode.Reset(); PlayerNode.Stop(); } }
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; } }