[FFmpeg-user] ADPCM block size for XAudio

Martin Wahnschaffe wahnschaffe at gmail.com
Thu Jan 4 08:57:53 EET 2018

Moritz Barsnick <barsnick at gmx.net> schrieb am Do., 4. Jan. 2018 um
00:09 Uhr:

> Have you tried the MS-ADPCM output of sox? I haven't gotten around to
> checking what it does, and have a hard time unterstanding the meaning
> of block size in the ADPCM context, and interpreting ffprobe's output.
> How could I test with Xaudio2, assuming I have access to Windows?

I have had a test with SoX now. It also doesn't work.

I have put together all the needed files for a test based on the directx
sdk basic sound sample (

You can find all the needed files here:

The Wavs folder contains an original wave file and the versions converted
with ffmpeg, sox and AdpcmEncode (a tool provided by microsoft).

These are the used commands:
AdpcmEncode original.wav adpcmencode.wav
ffmpeg -y -i original.wav -c:a adpcm_ms ffmpeg.wav

I think the blocksize is also relevant for the file length. The ffmpeg
encoded file is longer than the original one. I expect that a shorter block
size would change this (while having a worse compression). My understanding
is that adpcmencode.exe uses a blocksize that leads to the best compromise
between duration error and compression.

file            | audacity | ffprobe
original.wav    | 0.789s   | 0.79s
adpcmencode.wav | 0.789s   | 0.86s
ffmpeg.wav      | 0.831s   | 0.83s
sox.wav         | 0.831s   | 0.79s

I don't know why ffprobe gets a different length for adpcmencode.wav then
it really is.

XAudio2BasicSound.exe ist the compiled version of the contained code
(compiled with visual studio 2017 community). It will first play
original.wav, then adpcmencode.wav and finally ffmpeg.wav. The last one
failes with hresult 0x88960001 when calling pXaudio2->CreateSourceVoice.

Hope I got the email formatting correct this time.

> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list