<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _select_tts_engine(self):
 """ Select the TTS engine to be used by looking at the rconf object. """

        self.log(u"Selecting TTS engine...")
        requested_tts_engine = self.rconf[RuntimeConfiguration.TTS]
        if requested_tts_engine == self.CUSTOM:
            self.log(u"TTS engine: custom")
            tts_path = self.rconf[RuntimeConfiguration.TTS_PATH]
            if tts_path is None:
                self.log_exc(u"You must specify a value for tts_path", None, True, ValueError)
            if not gf.file_can_be_read(tts_path):
                self.log_exc(u"Cannot read tts_path", None, True, OSError)
            try:
                import imp
                self.log([u"Loading CustomTTSWrapper module from '%s'...", tts_path])
                imp.load_source("CustomTTSWrapperModule", tts_path)
                self.log([u"Loading CustomTTSWrapper module from '%s'... done", tts_path])
                self.log(u"Importing CustomTTSWrapper...")
                from CustomTTSWrapperModule import CustomTTSWrapper
                self.log(u"Importing CustomTTSWrapper... done")
                self.log(u"Creating CustomTTSWrapper instance...")
                self.tts_engine = CustomTTSWrapper(rconf=self.rconf, logger=self.logger)
                self.log(u"Creating CustomTTSWrapper instance... done")
            except Exception as exc:
                self.log_exc(u"Unable to load custom TTS wrapper", exc, True, OSError)
        elif requested_tts_engine == self.AWS:
            try:
                import boto3
            except ImportError as exc:
                self.log_exc(u"Unable to import boto3 for AWS Polly TTS API wrapper", exc, True, ImportError)
            self.log(u"TTS engine: AWS Polly TTS API")
            self.tts_engine = AWSTTSWrapper(rconf=self.rconf, logger=self.logger)
        elif requested_tts_engine == self.NUANCE:
            try:
                import requests
            except ImportError as exc:
                self.log_exc(u"Unable to import requests for Nuance TTS API wrapper", exc, True, ImportError)
            self.log(u"TTS engine: Nuance TTS API")
            self.tts_engine = NuanceTTSWrapper(rconf=self.rconf, logger=self.logger)
        elif requested_tts_engine == self.ESPEAKNG:
            self.log(u"TTS engine: eSpeak-ng")
            self.tts_engine = ESPEAKNGTTSWrapper(rconf=self.rconf, logger=self.logger)
        elif requested_tts_engine == self.FESTIVAL:
            self.log(u"TTS engine: Festival")
            self.tts_engine = FESTIVALTTSWrapper(rconf=self.rconf, logger=self.logger)
        elif requested_tts_engine == self.MACOS:
            self.log(u"TTS engine: macOS")
            self.tts_engine = MacOSTTSWrapper(rconf=self.rconf, logger=self.logger)
        else:
            self.log(u"TTS engine: eSpeak")
            self.tts_engine = ESPEAKTTSWrapper(rconf=self.rconf, logger=self.logger)
        self.log(u"Selecting TTS engine... done")