def make_ffmpeg_section_args(
    filename,
    start,
    length,
    *,
    before_options=(),
    options=(),
):
    """Returns a list of arguments to FFmpeg

    It will take the required amount of audio starting from the specified start
    time and convert them into PCM 16-bit stereo audio to be piped to stdout.

    The before_options argument will be passed after `-ss` and before `-i`, and
    the options argument will be passed after `-t` and before `pipe:1`.

    The returned args are of this form:

        -ss {start}
        -t {length}
        {before_options}
        -i {filename}
        -f s16le
        -ar 48000
        -ac 2
        -loglevel warning
        {options}
        pipe:1

    """
    if start is None:
        raise ValueError("start must be a float")
    if isinstance(before_options, str) or isinstance(options, str):
        # Strings are naughty. Force user to split them beforehand
        raise ValueError("FFmpeg options should be lists, not strings")
    return [
        "-ss", str(start),
        "-t", str(length),
        *(before_options or ()),
        "-i", filename,
        "-f", "s16le",
        "-ar", "48000",
        "-ac", "2",
        "-loglevel", "warning",
        *(options or ()),
        "pipe:1",
    ]