If files are located in subfolder thant it will not play even if to indicate file with path
Sound.swfit
should be changed to this function
public init(fileName: String, bundle: Bundle = Bundle.main) {
super.init()
let urlName = URL(fileURLWithPath: fileName)
let file = urlName.deletingPathExtension().path
let fileExtension = urlName.pathExtension
name = fileName
if let path = bundle.path(forResource: file, ofType: fileExtension) {
url = URL(fileURLWithPath: path)
identifier = url?.absoluteString ?? ""
}
preparePlayer()
}
If files are located in subfolder thant it will not play even if to indicate file with path
Sound.swfit
should be changed to this function