SyntaxFix
Write A Post
Hire A Developer
Questions
If code doesn't generate any error, but you don't hear sound - create the player as an instance:
static var player: AVAudioPlayer!
For me the first solution worked when I did this change :)