code: def ffmpeg_audiowrite(
      clip,
      filename,
      fps,
      nbytes,
      buffersize,
      codec="libvorbis",
      bitrate=None,
      write_logfile=False,
      ffmpeg_params=None,
      logger="bar",
  ):
      """
      A function that wraps the FFMPEG_AudioWriter to write an AudioClip
      to a file.
      """
      if write_logfile:
          logfile = open(filename + ".log", "w+")
      else:
          logfile = None
      logger = proglog.default_bar_logger(logger)
      logger(message="MoviePy - Writing audio in %s" % filename)
      writer = FFMPEG_AudioWriter(
          filename,
          fps,
          nbytes,
          clip.nchannels,
          codec=codec,
          bitrate=bitrate,
          logfile=logfile,
          ffmpeg_params=ffmpeg_params,
      )
  
      for chunk in clip.iter_chunks(
          chunksize=buffersize,
          quantize=True,
          nbytes=nbytes,
          fps=fps,
          logger=logger,
      ):
          writer.write_frames(chunk)
  
      writer.close()
  
      if write_logfile:
          logfile.close()
      logger(message="MoviePy - Done.")
  
file_path: moviepy/moviepy/audio/io/ffmpeg_audiowriter.py
imports: import subprocess
  import proglog
  from moviepy.config import FFMPEG_BINARY
  from moviepy.decorators import requires_duration
  from moviepy.tools import cross_platform_popen_params
label_desc: Use image node_id 1 for calling a global function with example usage: ffmpeg_audiowrite(clip, filename, fps, nbytes, buffersize, codec, bitrate, write_logfile, ffmpeg_params, logger) without return types