def extract_audio(clip, durations):
    """
    Given durations list extracts the clip's audio and
    divides it into pieces of given durations
    All the pieces are then written as 16-bit WAV files
    :param clip: The initial VideoClip instance
    :param durations: Durations for audios
    :return: A list of generated audio_filenames
    """
    audio = clip.audio
    audio_filenames = []
    start = 0
    for duration in durations:
        # 'pdm_s16le' codec stands for 16-bit WAV
        audio.subclip(start, start + duration).write_audiofile(f'temp/{start}.wav', codec='pcm_s16le')
        audio_filenames.append(f'temp/{start}.wav')
        start += duration

    return audio_filenames