This is the code i'm using:
var aSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("abc", ofType: "mp3")) var audioPlayer = AVAudioPlayer() println(aSound) audioPlayer = AVAudioPlayer(contentsOfURL: aSound, error: nil) audioPlayer.prepareToPlay() audioPlayer.play()
I'm trying to print the path of the file and this is what I see in the console.
file:///Users/<username>/Library/Developer/CoreSimulator/Devices/<some GUID>/data/Containers/Bundle/Application/<some different GUID>/HelloWorld.app/abc.mp3
I have added the mp3 to my project by doing an "Add Files to project" from the menu. Does it get added to the location above automatically when I run the simulator?