 					NSLog("PluginRTCAudioController#setOutputSpeakerIfNeed() | external audio output plugged in -> do nothing")
 				} else {
 					NSLog("PluginRTCAudioController#setOutputSpeakerIfNeed() | external audio pulled out")
-					
+
 					if (speakerEnabled) {
 						do {
 							try audioSession.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)

			NSLog("PluginRTCAudioController#setOutputSpeakerIfNeed() | requires connection to device")
		}
	}
	
	static func selectAudioOutputSpeaker() {
		// Enable speaker
		NSLog("PluginRTCAudioController#selectAudioOutputSpeaker()")
		
		speakerEnabled = true;
		
		setCategory()
		
		do {
			let audioSession: AVAudioSession = AVAudioSession.sharedInstance()
			try audioSession.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)

	//
	// Audio Output
	//

	static private var speakerEnabled: Bool = false

	init() {
		let shouldManualInit = Bundle.main.object(forInfoDictionaryKey: "ManualInitAudioDevice") as? String

		if(shouldManualInit == "FALSE") {
			PluginRTCAudioController.initAudioDevices()
		}

		NotificationCenter.default.addObserver(
			self,
			selector: #selector(self.audioRouteChangeListener(_:)),
			name: AVAudioSession.routeChangeNotification,
			object: nil)
	}

	@objc dynamic fileprivate func audioRouteChangeListener(_ notification:Notification) {
		let audioRouteChangeReason = notification.userInfo![AVAudioSessionRouteChangeReasonKey] as! UInt

		switch audioRouteChangeReason {
		case AVAudioSession.RouteChangeReason.newDeviceAvailable.rawValue:
			NSLog("PluginRTCAudioController#audioRouteChangeListener() | headphone plugged in")
