'Writes an audio file from the AudioClip.
Parameters
filename
Name of the output file
fps
Frames per second
nbyte
Sample width (set to 2 for 16-bit sound, 4 for 32-bit sound)
codec
Which audio codec should be used. If None provided, the codec is
determined based on the extension of the filename. Choose
\'pcm_s16le\' for 16-bit wav and \'pcm_s32le\' for 32-bit wav.
bitrate
Audio bitrate, given as a string like \'50k\', \'500k\', \'3000k\'.
Will determine the size and quality of the output file.
Note that it mainly an indicative goal, the bitrate won\'t
necessarily be the this in the output file.
ffmpeg_params
Any additional parameters you would like to pass, as a list
of terms, like [\'-option1\', \'value1\', \'-option2\', \'value2\']
write_logfile
If true, produces a detailed logfile named filename + \'.log\'
when writing the file
verbose
Boolean indicating whether to print infomation
progress_bar
Boolean indicating whether to show the progress bar.'

@requires_duration
def write_audiofile(self, filename, fps=44100, nbytes=2, buffersize=2000, codec=None, bitrate=None, ffmpeg_params=None, write_logfile=False, verbose=True, progress_bar=True):

    if (codec is None):
        (name, ext) = os.path.splitext(os.path.basename(filename))
        try:
            codec = extensions_dict[ext[1:]]['codec'][0]
        except KeyError:
            raise ValueError("MoviePy    couldn't    find    the    codec    associated    with    the    filename.    Provide    the    'codec'    parameter    in    write_videofile.")
    return ffmpeg_audiowrite(self, filename, fps, nbytes, buffersize, codec=codec, bitrate=bitrate, write_logfile=write_logfile, verbose=verbose, ffmpeg_params=ffmpeg_params, progress_bar=progress_bar)
