title: Linux: How to combine multiple FLAC audio files into 1 file, with differing sample rates, but not changing pitch
body: <p>I've looked everywhere to try to combine a bunch of FLAC files with differing sample rates into 1 file. What I've tried so far is:</p>
  
  <p>ffmpeg concat with a wildcard:</p>
  
  <p><code>ffmpeg -f concat -i &lt;( for f in *.flac; do echo "file '$(pwd)/$f'"; done ) -safe 0 output.flac</code></p>
  
  <p>I get for every filename, (even if I change pwd to './' for relative):</p>
  
  <p><code>ffmpeg unsafe filename</code></p>
  
  <p>Regardless of the file's filename.</p>
  
  <p>I've tried sox:</p>
  
  <p><code>sox *.flac output.flac</code></p>
  
  <p>Which leads to:</p>
  
  <p><code>sox FAIL sox: Input files must have the same sample-rate</code></p>
  
  <p>I've even tried combining the two:</p>
  
  <pre><code>#!/usr/bin/env bash
  
  set -eu
  
  for i in *.flac *.ogg *.mp3
  do
    ffmpeg -i "$i" "$i.wav"
  
  done
  
  sox *.wav combined.wav
  </code></pre>
  
  <p>Same error as above.</p>
  
  <p>Anyone have any tips? I'm sure that in some Windows program you can drag in 5 differing sound files and combine them with ease. Is there not a simple way to do this on linux cmdline?</p>