def _call_engine()

in tts/tts/services/synthesizer.py [0:0]


    def _call_engine(self, **kw):
        """
        Call engine to do the job.

        If no output path is found from input, the audio file will be put into /tmp and the file name will have
        a prefix of the md5 hash of the text.

        :param kw: what AmazonPolly needs to synthesize
        :return: response from AmazonPolly
        """
        if 'output_path' not in kw:
            tmp_filename = hashlib.md5(kw['text'].encode('utf-8')).hexdigest()
            tmp_filepath = os.path.join(os.sep, 'tmp', 'voice_{}_{}'.format(tmp_filename, str(time.time())))
            kw['output_path'] = os.path.abspath(tmp_filepath)
        self.logger.info('audio will be saved as {}'.format(kw['output_path']))

        return self.engine(**kw)