title: Errno 13 Permission denied: 'file.mp3' Python
body: <p>I am getting an error when writing to an audio file.</p>
  
  <p>Basically, I am overwriting the data in the mp3 whenever my function gets called and then playing it.</p>
  
  <p>It works the first time through, but then gives me <code>[Errno 13] Permission denied: 'file.mp3'</code> then on.</p>
  
  <p>Here is the code: </p>
  
  <pre><code>def speech(self, response):
      audio_file = "response.mp3"
      tts = gTTS(text=str(response), lang="en")
      tts.save(audio_file)
      pygame.mixer.init()
      pygame.mixer.music.load(audio_file)
      pygame.mixer.music.play()
  </code></pre>
  
  <p>Error is on the <code>tts.save</code> line.</p>
  
  <p>More info:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "myprojectpath", line 63, in speech
      tts.save(audio_file)
  
    File "C:\Python35\lib\site-packages\gtts\tts.py", line 93, in save
      with open(savefile, 'wb') as f:
  </code></pre>
  
  <p>Thanks!</p>