title: How to solve this error: AttributeError: 'NoneType' object has no attribute 'write_audiofile'
body: <pre><code>import moviepy.editor
  # Replace the parameter with the location of the video
  
  
  video = moviepy.editor.VideoFileClip(&quot;/home/amit/video2.mp4&quot;)
  audio = video.audio
  
  
  # Replace the parameter with the location along with filename
  audio.write_audiofile(&quot;/home/amit/output.mp3&quot;)
  </code></pre>
  <p>This is the code and getting this error:</p>
  <pre><code>AttributeError: 'NoneType' object has no attribute 'write_audiofile'
  </code></pre>