title: Swift2 setup a MTAudioProcessingTap to make a image bounce on the music beat
body: <p>He all, is anyone able to guide me a bit how to setup a audioprocessingtap in the keypath status, my goal is to make a image bounce on the beat of the music</p>
  
  <pre><code>    override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer&lt;Void&gt;) {
      let data: AVPlayerItem = object as! AVPlayerItem
  
      if keyPath == "status" {
          let track = data.tracks[0].assetTrack
          let avAudioMix = AVMutableAudioMixInputParameters.init(track: track)
          let callbacks = MTAudioProcessingTapCallbacks(avAudioMix)
          let session = AVAudioSession.sharedInstance()
          print("SESSION \(session)")
      }
  }
  </code></pre>
  
  <p>the audio is streaming audio with avplayer</p>
  
  <pre><code>    func methodOfReceivedNotification(notification: NSNotification){
      self.stream = notification.object! as! NSDictionary
      let stationid = notification.object!["stationid"]!
      let url = NSURL(scheme: "http", host: "adomain.com", path: "/listenstream/\(stationid!)/stream2.pls")
  
      if player != nil {
          do {
              PlayerItem.removeObserver(self, forKeyPath: "timedMetadata")
              PlayerItem.removeObserver(self, forKeyPath: "loadedTimeRanges")
              PlayerItem.removeObserver(self, forKeyPath: "playbackLikelyToKeepUp")
          }
      }
      PlayerItem = AVPlayerItem(URL: url!)
      PlayerItem.addObserver(self, forKeyPath: "timedMetadata", options: [], context: nil)
      PlayerItem.addObserver(self, forKeyPath: "loadedTimeRanges", options: [], context: nil)
      PlayerItem.addObserver(self, forKeyPath: "playbackLikelyToKeepUp", options: [], context: nil)
      PlayerItem.addObserver(self, forKeyPath: "status", options: [], context: nil)
  
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "gotMetaData:", name: "AVPlayerItemMetadataOutput", object: PlayerItem)
  
      player = AVPlayer(playerItem: PlayerItem)
      NSNotificationCenter.defaultCenter().postNotificationName("StreamDataSet", object: stream)
      NSNotificationCenter.defaultCenter().postNotificationName("BufferSetter", object: "buffering...")
      bufferText = "buffering..."
      startTimer()
  
  
  }
  </code></pre>