title: Combine audio files in Python
body: <p><br>
  How can I combined multiple audio files (wav) to one file in Python?
  I found this:</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>but this appends one audio file to the other. What I would like to have is code, that "stacks" the audio files (with volume controll please). Is this even possible in Python?</p>