I am trying to program an app that includes several songs. Looking through various tutorials they just say to "add your file to the project" or some such so I have tried adding my MP3 to various places (including xcassets) but it is never copied to the output of my project or played.
In other words, this always return nil:
let path = NSBundle.mainBundle().pathForResource(audioFile, ofType: "mp3")
It really is that simple. The only thing that you might have missed is that
audioFile should really only contain the name, not the file extension. But beyond that it is as easy as dragging the file into your project and you can play it.
In the following gif I have code that plays an audio file and does some manipulation to answer this question. But basically it just loads an audio file the same way you try it.