title: Adding / superimposing two wav files
body: <p>I'm interested in adding / superimposing two wav files using ffmpeg or a similar library that I can use at the unix command line in Mac OS X.  Note that I am not trying to <em>concatenate</em> the wav files.  Instead I am trying to yield a single merged wav file that has the same duration as the input wavs, which each have the same duration.  The total gain should be the sum of the input wavs at each sample.</p>
  
  <p>I have tried the following: </p>
  
  <pre><code>ffmpeg -i wav1.wav -i wav2.wav -filter_complex amix=inputs=2:duration=first:dropout_transition=3 wav_merged.wav
  </code></pre>
  
  <p>but it produces a wav file that is not as loud as the sum of the two wavs should be.    Further, I have read this post <a href="https://stackoverflow.com/questions/35318651/mixing-two-wav-files-in-ffmpeg">Mixing two wav files in FFmpeg</a> but I am not trying to do any looping and this solution is a bit complex.</p>