I\'m trying to get an audio file playing in my iOS app. This is my current code
NSString *soundFilePath = [NSString stringWithFormat:@\"%@/test.m4a\", [[NSBu
Swift 4.2
var soundFilePath = "\(Bundle.main.resourcePath ?? "")/test.m4a" var soundFileURL = URL(fileURLWithPath: soundFilePath) var player = try? AVAudioPlayer(contentsOf: soundFileURL) player?.numberOfLoops = -1 //Infinite player?.play()