     recorder.stop()
   }
 
-  public func play() {
-    session.setCategory(AVAudioSessionCategoryPlayback, error: nil)
+  public func play() throws {
+    try session.setCategory(AVAudioSessionCategoryPlayback)
 
-    player = AVAudioPlayer(contentsOfURL: url, error: nil)
+    player = try AVAudioPlayer(contentsOfURL: url)
     player.play()
   }
 
   public func updateMeter() {
     recorder.updateMeters()
 
-    var dB = recorder.averagePowerForChannel(0)
+    let dB = recorder.averagePowerForChannel(0)
 
     delegate.audioMeterDidUpdate?(dB)
   }

    recorder.meteringEnabled = metering
  }

  public func record() {
    if recorder == nil {
      prepare()
    }

    session.setCategory(AVAudioSessionCategoryRecord, error: nil)

    recorder.record()


  private func stopMetering() {
    link?.invalidate()
  }
}
