 class AudioMessageRecorder: NSObject, AVAudioRecorderDelegate {
 
     private var recorder: AVAudioRecorder?
-
-    override init() {
-        super.init()
-        setUpPermission()
-    }
+    private var recorderDelegate: AVAudioRecorderDelegate? = nil
 
     // MARK: Audio Session Helpers
 

    // MARK: Audio Recorder Methods

    func set(recorderDelegate: AVAudioRecorderDelegate) {
        recorder?.delegate = recorderDelegate
    }

    func record() {
        guard let audioRecorder = recorder else { return }

        if !audioRecorder.isRecording {
            setSession(active: true)
            audioRecorder.record()
        }
    }

    func stop() {
        recorder?.stop()

        setSession(active: false)
    }
}

        } catch let outError {
            print("Error for recorder init: \(outError).")
        }
        recorder?.delegate = recorderDelegate
        recorder?.isMeteringEnabled = true
        recorder?.prepareToRecord()
    }
