I have simple AVAudioPlayer in my iphone app, it works, but output should be phone speaker instead of headphone. I found similiar topic here , but don't know how to 'translate' that to swift (AudioSessionSetProperty is confusing me)?
var audioPlayer = AVAudioPlayer(data: fileData, error: &playbackError)
//fileData is url to file
if let player = audioPlayer{
player.delegate = self
if(player.prepareToPlay() && player.play()){
println("Started playing the recorded audio")
} else {
println("Could not play the audio")
}
}