 let session = AVAudioSession.sharedInstance()
 do {
     try session.setCategory(AVAudioSessionCategoryPlayback)
-    try session.overrideOutputAudioPort(.Speaker)
+    try session.overrideOutputAudioPort(.speaker)
     try session.setActive(true)
 } catch {
     fatalError("cannot create/set session \(error)")

delay.wetDryMix = 100

let reverb = AVAudioUnitReverb()
reverb.loadFactoryPreset(.Cathedral)
reverb.wetDryMix = 50

var timePitch = AVAudioUnitTimePitch()
timePitch.pitch = 100 // cents
timePitch.rate = 2

engine.attachNode(player)
engine.attachNode(delay)
engine.attachNode(reverb)
engine.attachNode(timePitch)

let format = audioFile!.processingFormat
engine.connect(player, to: delay, format: format)



//player.scheduleFile(audioFile!, atTime: nil, completionHandler: nil)
player.scheduleFile(audioFile!, at: nil) {
    print("done")
    player.rate = 0.5
    player.play()
