Convert the audio file at ``input_file_path``
        into ``output_file_path``,
        using the parameters set in the constructor
        or through the ``parameters`` property.

        You can skip the beginning of the audio file
        by specifying ``head_length`` seconds to skip
        (if it is ``None``, start at time zero),
        and you can specify to convert
        only ``process_length`` seconds
        (if it is ``None``, process the entire input file length).

        By specifying both ``head_length`` and ``process_length``,
        you can skip a portion at the beginning and at the end
        of the original input file.

        :param string input_file_path: the path of the audio file to convert
        :param string output_file_path: the path of the converted audio file
        :param float head_length: skip these many seconds
                                  from the beginning of the audio file
        :param float process_length: process these many seconds of the audio file
        :raises: :class:`~aeneas.ffmpegwrapper.FFMPEGPathError`: if the path to the ``ffmpeg`` executable cannot be called
        :raises: OSError: if ``input_file_path`` does not exist
                          or ``output_file_path`` cannot be written

def convert(
            self,
            input_file_path,
            output_file_path,
            head_length=None,
            process_length=None
    ):
        """
        Convert the audio file at ``input_file_path``
        into ``output_file_path``,
        using the parameters set in the constructor
        or through the ``parameters`` property.

        You can skip the beginning of the audio file
        by specifying ``head_length`` seconds to skip
        (if it is ``None``, start at time zero),
        and you can specify to convert
        only ``process_length`` seconds
        (if it is ``None``, process the entire input file length).

        By specifying both ``head_length`` and ``process_length``,
        you can skip a portion at the beginning and at the end
        of the original input file.

        :param string input_file_path: the path of the audio file to convert
        :param string output_file_path: the path of the converted audio file
        :param float head_length: skip these many seconds
                                  from the beginning of the audio file
        :param float process_length: process these many seconds of the audio file
        :raises: :class:`~aeneas.ffmpegwrapper.FFMPEGPathError`: if the path to the ``ffmpeg`` executable cannot be called
        :raises: OSError: if ``input_file_path`` does not exist
                          or ``output_file_path`` cannot be written
        """
        # test if we can read the input file
        if not gf.file_can_be_read(input_file_path):
            self.log_exc(u"Input file '%s' cannot be read" % (input_file_path), None, True, OSError)

        # test if we can write the output file
        if not gf.file_can_be_written(output_file_path):
            self.log_exc(u"Output file '%s' cannot be written" % (output_file_path), None, True, OSError)

        # call ffmpeg
        arguments = [self.rconf[RuntimeConfiguration.FFMPEG_PATH]]
        arguments.extend(["-i", input_file_path])
        if head_length is not None:
            arguments.extend(["-ss", head_length])
        if process_length is not None:
            arguments.extend(["-t", process_length])
        if self.rconf.sample_rate in self.FFMPEG_PARAMETERS_MAP:
            arguments.extend(self.FFMPEG_PARAMETERS_MAP[self.rconf.sample_rate])
        else:
            arguments.extend(self.FFMPEG_PARAMETERS_DEFAULT)
        arguments.append(output_file_path)
        self.log([u"Calling with arguments '%s'", arguments])
        try:
            proc = subprocess.Popen(
                arguments,
                stdout=subprocess.PIPE,
                stdin=subprocess.PIPE,
                stderr=subprocess.PIPE
            )
            proc.communicate()
            proc.stdout.close()
            proc.stdin.close()
            proc.stderr.close()
        except OSError as exc:
            self.log_exc(u"Unable to call the '%s' ffmpeg executable" % (self.rconf[RuntimeConfiguration.FFMPEG_PATH]), exc, True, FFMPEGPathError)
        self.log(u"Call completed")

        # check if the output file exists
        if not gf.file_exists(output_file_path):
            self.log_exc(u"Output file '%s' was not written" % (output_file_path), None, True, OSError)

        # returning the output file path
        self.log([u"Returning output file path '%s'", output_file_path])
        return output_file_path