Convert WAV to PCM using FFmpeg


FFmpeg has binaries for Windows. It is also available for Linux and other operating systems. That makes it more ubiquitous than GStreamer, which I have used for PCM to WAV conversion in the past.

Here’s the command line for converting a WAV file to raw PCM. If your distribution provides Libav instead, replace ffmpeg with avconv.

ffmpeg -i file.wav -f s16be -ar 8000 -acodec pcm_s16be file.raw

s16be indicates that the output format is signed 16-bit big-endian. The audio rate is changed to 8000 Hz.

You can import and play raw PCM using Audacity.

8 thoughts on “Convert WAV to PCM using FFmpeg

    1. Try:

      ffmpeg -f s16be -ar 8000 -ac 1 -acodec pcm_s16be -i file.raw file.wav
      

      Change -ac (audio channels) to 2 if you have stereo audio.

  1. how to use this command to convert lots of wav files situated in a nested directory structure to raw format?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s