Opened 21 months ago
Last modified 15 months ago
#9397 open enhancement
Allow any ADPCM block size to support XAudio2
Reported by: | Thomas Cashman | Owned by: | zane |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Related to https://trac.ffmpeg.org/ticket/6585 and https://github.com/MonoGame/MonoGame/issues/5662
Microsoft measures the size of a block in samples for XAudio2 (https://msdn.microsoft.com/de-de/library/windows/desktop/ee415711(v=vs.85).aspx).
From Github thread:
FFMPEG forces the block size to be a power of 2 which appears to generate invalid samples per block. A block size of 70 would be needed to generate a valid 128 samples per block.
How to reproduce:
% ffmpeg.exe -y -i sample.ogg -vn -c:a adpcm_ms -block_size 70 -b:a 128000 -ar 36000 -f:a wav -strict experimental result.wav ffmpeg version 4.4 Downloaded from https://github.com/BtbN/FFmpeg-Builds/releases
Change History (2)
follow-up: 2 comment:1 by , 15 months ago
Owner: | set to |
---|---|
Status: | new → open |
comment:2 by , 15 months ago
Replying to zane:
Could you please comment out this block at
libavcodec/adpcmenc.c:92
and see if the generated file works?
I can confirm this change works.
I've just commented out the block, built FFmpeg with MSYS2, used that to create an ADPCM audio file with a block size of 70 and then successfully played that through XAudio2 (via a monogame project).
I suspect the fix is a simple matter of relaxing the check.
Could you please comment out this block at
libavcodec/adpcmenc.c:92
and see if the generated file works?