Write the audio data to file.
        Return ``True`` on success, or ``False`` otherwise.

        :param string file_path: the path of the output file to be written
        :raises: :class:`~aeneas.audiofile.AudioFileNotInitializedError`: if the audio file is not initialized yet

        .. versionadded:: 1.2.0

def write(self, file_path):
        """
        Write the audio data to file.
        Return ``True`` on success, or ``False`` otherwise.

        :param string file_path: the path of the output file to be written
        :raises: :class:`~aeneas.audiofile.AudioFileNotInitializedError`: if the audio file is not initialized yet

        .. versionadded:: 1.2.0
        """
        if self.__samples is None:
            if self.file_path is None:
                self.log_exc(u"AudioFile object not initialized", None, True, AudioFileNotInitializedError)
            else:
                self.read_samples_from_file()
        self.log([u"Writing audio file '%s'...", file_path])
        try:
            # our value is a float64 in [-1, 1]
            # scipy writes the sample as an int16_t, that is, a number in [-32768, 32767]
            data = (self.audio_samples * 32768).astype("int16")
            scipywavwrite(file_path, self.audio_sample_rate, data)
        except Exception as exc:
            self.log_exc(u"Error writing audio file to '%s'" % (file_path), exc, True, OSError)
        self.log([u"Writing audio file '%s'... done", file_path])