2

How to encode WAV PCM into WAV with ADPCM encoding?

I tried FFmpeg. I can see from the old FFmpeg codec list, that it previously supported encoding into adpcm_adx, adpcm_ima_qt, adpcm_ima_wav, adpcm_ms, adpcm_swf and adpcm_yamaha. However, these codecs seem to be not included into FFmpeg anymore (at least, in my v.4.1.3 installation).

The purpose is to include a miniature audio file into an embedded project and then decode it with dr_wav library, which supports IMA ADPCM and Microsoft ADPCM.

Andriy Makukha
  • 343
  • 4
  • 11
  • 1
    My copy of (Arch Linux built) ffmpeg 4.1.3 still lists all these codecs _and more_ (adpcm_g722, adpcm_g726) available for encoding under 'ffmpeg -codecs'. Could you clarify how you installed ffmpeg yourself, and include the output of **`ffmpeg -version`**? – u1686_grawity May 26 '19 at 10:16
  • @grawity, thanks for help! I was looking at `ffmpeg -formats | grep adpcm` instead of `ffmpeg -codecs | grep adpcm`. Silly me... And I also was using `-f` option instead of `-acodec`, so I got confused by `Requested output format 'adpcm_ms' is not a suitable output format` error... – Feel free to provide an answer. – Andriy Makukha May 26 '19 at 11:46

1 Answers1

5

Just to close the question, here are two ways to convert audio into WAV with ADPCM encoding:

1) With FFmpeg:

ffmpeg -i INPUT.wav -f wav -acodec adpcm_ms OUTPUT.wav

2) With SoX:

sox INPUT.wav -e ms-adpcm OUTPUT.wav

Thanks to @grawity for the help!

Andriy Makukha
  • 343
  • 4
  • 11