I have a file on documents folder of app and I want to play it.
if NSFileManager.defaultManager().fileExistsAtPath(pathString) {
let url = NSURL(fileURLWithPath:pathString, isDirectory: false)
do {
let player = try AVAudioPlayer(contentsOfURL:url)
player.prepareToPlay()
player.play()
}
catch let error as NSException {
print(error)
}
catch {}
}
There is a file on file system and I checked its existence. Also all lines in do block are executed. There is neither exception nor error and still no sound is played. What are possible problems and how can I solve them?