title: How do I save multiple audio files in a loop?
body: <p>I have multiple audio files which I have added white noise to using librosa. How do I save these new audio files in a loop now?</p>
  
  <p>I used this article for the main computations: <a href="https://medium.com/@alibugra/audio-data-augmentation-f26d716eee66" rel="nofollow noreferrer">https://medium.com/@alibugra/audio-data-augmentation-f26d716eee66</a> and I have attached the rest of my code below. I don't know how to handle the last line in the for loop in this context. Assume that I have about 100 audio files. </p>
  
  <pre><code>path = "XXXXXX"
  files = librosa.util.find_files(path, ext = ['wav'])
  files = np.asarray(files)
  
  a=AudioConfiguration()
  for y in files:
      data = librosa.load(y, sr = 1600, mono = True)
      data = data[0]
      data_noise = a.add_noise(data)
      new_name = "output{1}.wav".format(filename)
      a.write_audio_file(new_name, data_noise)
  </code></pre>
  
  <p><strong>Update: Here's the solution</strong></p>
  
  <pre><code>for i in range (1, x):
      filename.write_audio_file("final_dataset/noise_%d.wav" %i, data_noise)
  </code></pre>