title: How to join multiple .wav files with python
body: <p>I saw a post that joined two .wav files together, but I was wondering how can I join multiple .wav files using python? I am using python 3.6.0. If anyone has a way to do this please teach me. I saw that the other post ask for joining 2 .wav files and with that I used this code form the comments there:</p>
  
  <pre><code>import wave
  infiles = ["sound_1.wav", "sound_2.wav"]
  outfile = "sounds.wav"
  
  data= []
  for infile in infiles:
      w = wave.open(infile, 'rb')
      data.append( [w.getparams(), w.readframes(w.getnframes())] )
      w.close()
  
  output = wave.open(outfile, 'wb')
  output.setparams(data[0][0])
  output.writeframes(data[0][1])
  output.writeframes(data[1][1])
  output.close()
  </code></pre>
  
  <p>I want to read my .wav files from a path then join it as one. I was thinking that after I add the first 2 .wav files I would delete them and just keep joining and deleting until only one .wav file remains like this:</p>
  
  <pre><code>file:
  sound1.wav
  sound2.wav
  sound3.wav
  
  code:
  sound1.wav + sound2.wav = sound4.wav
  
  file:
  sound3.wav
  sound4.wav
  
  code:
  sound4.wav + sound3.wav = sound5.wav
  
  file:
  sound5.wav
  </code></pre>
  
  <p>I just don't know how to code this. I am new to coding with python and I am not that good with coding programming languages in general.
  Thanks in advances. </p>