     
     
     func playAudioWithVariablePitch(pitch: Float){
-        audioPlayer.stop()
-        audioEngine.stop()
-        audioEngine.reset()
+        stopAudioPlaying()
         
         let audioPlayerNode = AVAudioPlayerNode()
         audioEngine.attachNode(audioPlayerNode)

    }
    
    @IBAction func playSlowAudio(sender: UIButton) {
        // MARK: task 2
        audioPlayer.stop()
        audioEngine.stop()
        audioEngine.reset()
        
        // MARK: play audio slow
        stopButton.hidden = false
        audioPlayer.stop()
        audioPlayer.currentTime = 0
        audioPlayer.rate = 0.5
        audioPlayer.play()

    
    @IBAction func playFastAUdio(sender: AnyObject) {
        // MARK: task 2
        stopAudioPlaying()
        
        // MARK: play audio fast
        stopButton.hidden = false
        audioPlayer.currentTime = 0
        audioPlayer.rate = 2
        audioPlayer.play()
