Simple code without error handling to play audio from your local path import AVFoundation var audio:AVPlayer! func stopAlarm() { // To pause or stop audio in swift 5 audio.stop() isn't working audio.pause() } func playAlarm() { // need to declare local path as url let url = Bundle.main.url(forResource: "Alarm", withExtension: "mp3") // now use declared path 'url' to initialize the player audio =..