class_docstr: A class to write an AudioClip into an audio file.
  
  Parameters
  ----------
  
  filename
    Name of any video or audio file, like ``video.mp4`` or ``sound.wav`` etc.
  
  size
    Size (width,height) in pixels of the output video.
  
  fps_input
    Frames per second of the input audio (given by the AUdioClip being
    written down).
  
  codec
    Name of the ffmpeg codec to use for the output.
  
  bitrate:
    A string indicating the bitrate of the final video. Only
    relevant for codecs which accept a bitrate.
class_docstr_tok: ["A","class","to","write","an","AudioClip","into","an","audio","file",".","Parameters","--","--","--","--","--","filename","Name","of","any","video","or","audio","file",",","like","``","video.mp4","``","or","``","sound.wav","``","etc",".","size","Size","(","width",",","height",")","in","pixels","of","the","output","video",".","fps_input","Frames","per","second","of","the","input","audio","(","given","by","the","AUdioClip","being","written","down",")",".","codec","Name","of","the","ffmpeg","codec","to","use","for","the","output",".","bitrate",":","A","string","indicating","the","bitrate","of","the","final","video",".","Only","relevant","for","codecs","which","accept","a","bitrate","."]
docstr: TODO: add documentation
docstr_tok: ["TODO",":","add","documentation"]
code: def write_frames(self, frames_array):
      """TODO: add documentation"""
      try:
          self.proc.stdin.write(frames_array.tobytes())
      except IOError as err:
          _, ffmpeg_error = self.proc.communicate()
          if ffmpeg_error is not None:
              ffmpeg_error = ffmpeg_error.decode()
          else:
              # The error was redirected to a logfile with `write_logfile=True`,
              # so read the error from that file instead
              self.logfile.seek(0)
              ffmpeg_error = self.logfile.read()
  
          error = (
              f"{err}\n\nMoviePy error: FFMPEG encountered the following error while "
              f"writing file {self.filename}:\n\n {ffmpeg_error}"
          )
  
          if "Unknown encoder" in ffmpeg_error:
              error += (
                  "\n\nThe audio export failed because FFMPEG didn't find the "
                  f"specified codec for audio encoding {self.codec}. "
                  "Please install this codec or change the codec when calling "
                  "write_videofile or write_audiofile.\nFor instance for mp3:\n"
                  "   >>> write_videofile('myvid.mp4', audio_codec='libmp3lame')"
              )
  
          elif "incorrect codec parameters ?" in ffmpeg_error:
              error += (
                  "\n\nThe audio export failed, possibly because the "
                  f"codec specified for the video {self.codec} is not compatible"
                  f" with the given extension {self.ext}. Please specify a "
                  "valid 'codec' argument in write_audiofile or 'audio_codoc'"
                  "argument in write_videofile. This would be "
                  "'libmp3lame' for mp3, 'libvorbis' for ogg..."
              )
  
          elif "bitrate not specified" in ffmpeg_error:
              error += (
                  "\n\nThe audio export failed, possibly because the "
                  "bitrate you specified was too high or too low for "
                  "the audio codec."
              )
  
          elif "Invalid encoder type" in ffmpeg_error:
              error += (
                  "\n\nThe audio export failed because the codec "
                  "or file extension you provided is not suitable for audio"
              )
  
          raise IOError(error)
  
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 2 for calling the FFMPEG_AudioWriter obj's underlying member method code with example usage: obj.write_frames(frames_array) without return types