-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADPCM support #41
Comments
Yep. Generally speaking, even if a format or codec is not on the "roadmap" I'll accept it as long as it works and the code is maintainable. I think ADPCM support would be a great addition.
You're correct. I think we should keep ADPCM and PCM separate. To that end, I think you should just copy You'll also need to extend the
I actually think most of your work will end up being in Other than that, let me brain dump a few other things you'll have to do to tie everything together:
Once that's done, everything should just work ™️ . One final thought. As per the Microsoft doc, the blocks can be as small as 32 samples. That's pretty small considering the work involved to get a parse a new block, allocate a packet, decode the packet, write to audio output, etc. Since the block size can be calculated, it may make sense to provide > 1 block per
I think Probably the best thing to do is just try to implement it, submit a PR, and we can iterate on it. |
I'd like to use Symphonia with some WAV files containing ADPCM data. Specifically, I'd like to support the "Microsoft ADPCM" (RIFF format 0x021) and "IMA/DVI ADPCM" (RIFF format 0x11) variants. There are also possibly a couple extensions2 that I need to support.
Just these two account for most of the ADPCM I've encounted in the wild, and to some extent rounds out the set of codecs that you most commonly find in WAV files, IME. The various other variants use can of course be added later when/if needed — I think there are a couple that likely will be useful (like QuickTime's "IMA4 ADPCM").
Anyway, I'd be willing to provide the code for those two (I have some parsing code lying around for them, and encoding is easy enough as well).
The reason I'm filing an issue first (rather than just a PR) is:
To make sure you'd accept it.
I am unsure where they should live. Or rather, I suspect the answer is "A new
symphonia-codec-adpcm
crate, but it seems worth asking about this first.I think there's a strong possibility you considered the existence of ADPCM when writing the WAV code, and possibly have thoughts on where it should live, but I could be wrong
So I have somewhere to ask questions when I inevitably get lost due to my vague-at-best understanding of how Symphonia is structured 😅
One final note is that while
libavcodec
(codec library behind ffmpeg)'s support for ADPCM is pretty thorough,ffmpeg
's usage of it used to introduce many strange bugs. So, I'm a little concerned about testing against it as with symphonia-check... I guess we'll cross that it it becomes an issue, though, since it may have been fixed in the 3 years since I tried last.(footnotes)
I'm specifying the format ID because pretty much every name you could use to describe the different flavors of ADPCM is somewhat ambiguous. There are at least 3 codecs reasonably called "DVI ADPCM" and two reasonably called "Microsoft ADPCM", and these have overlap (it's kind of a disaster).
Specifically, the two important extensions are:
Note that I'm unsure that these are actually extensions.
The text was updated successfully, but these errors were encountered: