Found your GitHub repo, unfortunately it did not contain the Xcode project file so couldn't get it up and running.
I would change this:
guard let url = Bundle.main.url(forResource: chimesSoundEffect, withExtension: "mp3") else { return }
to this:
guard let url = Bundle.main.url(forResource: chimesSoundEffect, withExtension: "mp3") else {
print("No sound file found")
return
}
To see if the file is actually found. Furthermore, I would change this:
let chimesSoundEffect = "Chimes-sound-effect.mp3"
to this:
let chimesSoundEffect = "Chimes-sound-effect"
Since you already have the withExtension in the Bundle.url call.
Also I would check if you have included the mp3 file in the Target membership of the app:
1. First in Xcode, select the mp3 file in the left hand side where the project files are.
2. Check from the Inspector (View > Inspectors > File) and then see from the Target Membership section if there is a check in the checkbox for the app target.
If not, the mp3 file is not included in the target binary and cannot be found.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: