This checkout stayed at ce5837f while later work was pushed from the same
working copy: the MP3, Ogg, Vorbis and WAV decoders left for core Ziran,
Opus decoding moved into decode_opus and ogg_opus, and the tests and
native build follow. The commit records the working copy as it is so the
remote history can be merged without losing local edits.
audio/ogg_vorbis inspects Ogg Vorbis portably: audio/ogg's reader checks
every page, then the identification, comment and setup headers are parsed
and the setup header's mode table is read backwards from its framing bit,
so each audio packet's block size and every granule position are checked.
The exact frame count is the final granule position. Chained or
multiplexed streams, timeline offsets, more than two channels and rates
outside 8-192 kHz are Unsupported; truncation, CRC errors and granule
mismatches are Malformed. Vorbis comments are copied and read by index or
case-insensitive field name.
audio/vorbis decodes through stb_vorbis 1.24 (nothings/stb 9600522d,
public domain or MIT), compiled by native/ziran_vorbis.c into
libziran_vorbis.a: open from memory or a file, float and s16 streaming,
whole-file decode, exact seek and rewind. The read call keeps decoding past
frames that return no samples, which stb_vorbis' own interleaved reader
treats as the end. audio/vorbis_resample adds the best-sinc resampler.
The CLI detects Vorbis next to Opus for inspect, decode, resample and
transcode. Vorbis contracts decode five FFmpeg/libvorbis fixtures within
0.501 PCM16 steps of FFmpeg, check exact lengths, streaming, s16, seeks,
comments, synthetic and malformed streams and 600 corrupted decodes, and
pass under ASan and UBSan. The Windows and Android runs cover the Vorbis
fixtures too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add audio/mpeg_audio, portable MPEG audio stream inspection: ID3v2,
ID3v1 and APEv2 tags, Xing/Info, VBRI and LAME gapless headers, and a
walk of every frame header for exact duration, bitrate, VBR/CBR and
truncation. Add audio/mp3, the dr_mp3 decoder for MPEG-1/2/2.5 Layers
I-III: open from memory or a file, interleaved f32 and s16 chunk reads,
exact seeks over a bound seek table, rewind and whole-file decode. Add
audio/mp3_resample for whole-file decode at another rate through
audio/resample, kept apart so decode-only consumers need no
libsamplerate.
dr_libs is pinned as a source dependency at f12e197 (dr_mp3 0.7.5) and
built into libziran_mp3.a by native/AudioCodecs.cmake (ziran_audio_mp3)
for Linux, Android and Windows MinGW. The CLI inspects, decodes,
resamples and transcodes MP3, choosing the format from the content.
Tests decode committed FFmpeg/libmp3lame fixtures (CBR, Xing VBR, mono,
MPEG-2 22.05 kHz, MPEG-2.5, no Xing header, Layer II, ID3v2+ID3v1)
against FFmpeg's PCM within 1.5 PCM16 steps, and check exact durations,
streamed, rewound and s16 output, exact seeks, and truncated, corrupt
and non-MP3 input. make sanitize-test runs the native contracts under
ASan/UBSan. The Windows and Android checks cover MP3 too; Android
builds now pass --target-os android so std maps files with bionic's
calls.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opus encode/decode, Ogg Opus inspection, best sinc resampling and WAV I/O
for Ziran, with the native audio CLI and its local tests.
Pin xiph/opus v1.5.2 and libsamplerate 0.2.2 as source dependencies and
add native/AudioCodecs.cmake, which builds static opus and samplerate
targets for NDK consumers. make android-test builds them and the CLI for
arm64-v8a, armeabi-v7a, x86 and x86_64, and with ANDROID_SERIAL runs
inspect, decode, resample and encode on the device against the Linux CLI.