Soundable
Soundable copied to clipboard
play from folder
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()
}
Thanks for the report @duca14036. I haven't been able to reproduce the issue by creating subfolders and placing the audios there. Do you have a more concrete example, like where are you creating the subfolders or if you are trying to reproduce a sound located in a subfolder different than the bundle?.