def _make_audio_file_fullpath()

in tts/src/tts/amazonpolly.py [0:0]


    def _make_audio_file_fullpath(self, output_path, output_format):
        """Makes a full path for audio file based on given output path and format.

        If ``output_path`` doesn't have a path, current path is used.

        :param output_path: the output path received
        :param output_format: the audio format, e.g., mp3, ogg_vorbis, pcm
        :return: a full path for the output audio file. File ext will be constructed from audio format.
        """
        head, tail = os.path.split(output_path)
        if not head:
            head = self.default_output_folder
        if not tail:
            tail = self.default_output_file_basename

        file_ext = {'pcm': '.wav', 'mp3': '.mp3', 'ogg_vorbis': '.ogg'}[output_format.lower()]
        if not tail.endswith(file_ext):
            tail += file_ext

        return os.path.realpath(os.path.join(head, tail))