Post not yet marked as solved
Post marked as unsolved with 1 replies, 455 views
Hello everybody, I'm trying to add sound effects to entities but I'm not being able to load audio assets from URL or main bundle Url, here's my code:
let resource = try AudioFileResource.load(contentsOf: audioFileURL, withName: path, inputMode: .spatial, loadingStrategy: .preload, shouldLoop: true)
let audioController = entity.prepareAudio(resource)
audioController.play()
} catch {
print("Error while loading audio file...")
}
where this is my URL:
file:///var/mobile/Containers/Data/Application/B338F8B5-2FC6-4B90-9720-271E5362906A/Documents/Griffin.wav.
any help would be very appreciate, thanks you so much!