+ make legacy audio writers real - #105
Merged
Merged
Conversation
Hawkynt
force-pushed
the
feat/audio-rw-codecs
branch
3 times, most recently
from
August 29, 2026 03:45
b4e1e1f to
c509d03
Compare
Hawkynt
force-pushed
the
feat/audio-rw-codecs
branch
from
August 29, 2026 05:19
893ba17 to
60dc369
Compare
Adds Microsoft/Intel IMA ADPCM WAV-block encoding, Apple ima4 packet encoding, and Microsoft ADPCM with a canonical predictor-pair search and adaptive delta state, with mono/stereo, packet-layout, padding, determinism and lossy-tolerance coverage for both families. Bonk becomes creatable from one or two mono PCM16 WAV channels through the codec's own lossless writer, with byte-exact container tests, and the writable QOA, DFPWM and Bonk assemblies are bundled in Hawkynt.FileFormats.Audio. Both decoders clamped a byte against an int literal, which is ambiguous.
Hawkynt
force-pushed
the
feat/audio-rw-codecs
branch
from
August 29, 2026 08:49
60dc369 to
19ed2c5
Compare
Hawkynt
force-pushed
the
feat/audio-rw-codecs
branch
from
August 29, 2026 09:09
19ed2c5 to
92b2035
Compare
Hawkynt
added a commit
that referenced
this pull request
Aug 29, 2026
… building (#127) #105 and #106 were each green on their own branch and collided on the squash commit no run ever saw. #106 added the span-based encoders in {Ima,Ms}AdpcmCodec.Encode.cs; #105 then rewrote {Ima,Ms}AdpcmCodec.cs to carry its own list-based encoders, re-declaring helpers the partial already had. Both public surfaces stay - AdpcmEncodeTests covers the list-based pair and AdpcmEncoderTests the span-based pair, so neither is dead. IMA: the two EncodeNibble bodies were the same quantizer, so the partial's copy goes and every caller uses the one in the main file; short widens to int. Its copies of QuickTimePacketBytes, QuickTimeSamplesPerPacket and StartIndexFor go for the same reason. MS: the two are genuinely different - the main file quantizes the residual directly, the partial searches all sixteen nibbles for the smallest error - so the partial's keeps its body and takes the name SearchNibble. Sharing the name was what made a short argument silently pick the search over the quantizer. DecodeNibble takes the predictor index by value now that it is no longer mutated per nibble, which is what the rewrite in #105 established.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ima4packet encodingFileFormat.Bonkcreatable from one/two mono PCM16 WAV channels using the codec's existing lossless writerHawkynt.FileFormats.AudioVerification
Scope note
This deliberately does not claim fake encoders for MP3/AAC/Opus/Vorbis/WMA/DTS/etc. Those require real psychoacoustic/transform encoders and interoperability vectors; flipping the matrix without that machinery would be worse than leaving them read-only.