Posts

Post marked as solved
2 Replies
2k Views
Hi.I'm programming an app (MacOS, not iOS) in which I want to play external mp3 files. The path to the file and some information I need are stocked in a tableView. When I add the file to the tableView, through a NSOpenPanel, there is no problem, I can play my mp3 without any problem. If I close the app, and open it again, the tableView has its content, with the paths to the files, but, then, the AVURLAsset is classified not playable. I can't have any information about the length of the sound, etc, and can't play it...let url = URL.init(fileURLWithPath: filePath, isDirectory: false) let fileManager = FileManager.default let soundAsset: AVURLAsset = AVURLAsset(url: url) print("Path : \(soundAsset.url.path)") print("Sound is playable : \(soundAsset.isPlayable)") print("File at this path exists : \(fileManager.fileExists(atPath: sound.fileUrl))")The path is correct, the soundAsset is not playable, the file exists...What am I missing? Any suggestion? Thanks...
Posted
by Olivion.
Last updated
.