audio_decode 0.3.2
audio_decode: ^0.3.2 copied to clipboard
Decode MP3 and Ogg Vorbis to raw PCM in Dart, over FFI. Compiles stb_vorbis and minimp3 from source: self-contained, pure-Dart friendly, no platform plugins or prebuilt binaries.
0.3.2 #
- Fix the int32 overflow from 0.3.1 on the Ogg Vorbis path as well.
ad_info_vorbisread the stream length from the final page's granule position as anunsigned intand narrowed it into the caller'sintout parameter with no range check, so a stream whose granule passed 2^31 (about 13.5 hours at 44.1 kHz) wrapped to a negative value thatoggInfoandaudioInfosurfaced as a negativeframeCountanddurationwith no error. The Vorbis info path now rejects the overflow with anAudioDecodeException, the same guard the MP3 path already carried.
0.3.1 #
- Fix an int32 overflow: the MP3 decoder accumulated the per-channel sample
count in a native
size_tbut narrowed it into the caller'sintout parameter with no overflow check. A stream whose per-channel sample count passed 2^31 (about 13.5 hours at 44.1 kHz) wrapped to a negative value, whichmp3Info/audioInfosurfaced as a negativeframeCountanddurationwith no error, and whichdecodeMp3could turn into an unfreed native buffer surfaced as an unrelatedArgumentError. Both paths now reject the overflow explicitly (AudioDecodeException) instead of wrapping, and_decodefrees the native buffer in afinallyeven if the copy into Dart memory throws.
0.3.0 #
- Add
PcmAudio.toFloat32(),PcmAudio.channel(int)andPcmAudio.toMono(). The samples were only exposed as raw interleavedInt16List, so waveform, analysis and machine-learning callers all had to write the same divide-by-32768 loop and manual channel split.toFloat32returns the normalized[-1.0, 1.0]floats,channeldeinterleaves one channel into aFloat32List, andtoMonoaverages the channels into a monoPcmAudio. All additive; existing fields and methods are unchanged.
0.2.3 #
- Widen the native-toolchain constraints so the package can be installed in a
Flutter app at all.
hooks2.1.0 andnative_toolchain_c0.19.3 raised theirmetafloor to ^1.19.0, and Flutter's SDK pinsmetato 1.17.0, soflutter pub addfailed at version solving with "flutter from sdk is incompatible". Allowinghooks >=2.0.2andnative_toolchain_c >=0.19.2lets the solver pick a version that works with the pinnedmeta, while a pure-Dart project still resolves to the newest. No API or behaviour change.
0.2.2 #
- Shorten the screenshot description. pub.dev accepts up to 200 characters but scores only those under 160, so the previous release published cleanly and quietly gave up the documentation points it was meant to earn.
0.2.1 #
- Declare the diagram in
pubspec.yamlso pub.dev renders it on the package page. It was already in the repository and the README, but pub.dev shows only what thescreenshots:field points at.
0.2.0 #
- Add
audioInfo,oggInfoandmp3Info, which return anAudioInfowithsampleRate,channels,frameCountanddurationwithout decoding to PCM. Reading a track's length used to mean decoding the whole file, which for four minutes of 44.1 kHz stereo materializes 40 MB of samples you then throw away. The new calls allocate no PCM: Vorbis answers from the container, and MP3 walks its frame headers with the decoder's synthesis step skipped. Measured on a one-second stereo fixture (Apple M-series, warmed up): Ogg 107 µs against 511 µs for a full decode, MP3 0.9 µs against 217 µs. The reported geometry is checked againstdecodeAudiofor every test fixture.
0.1.3 #
- Example: show what to do with the decoded PCM, not just how to re-encode it. It now reduces the samples to a one-line waveform (peak amplitude per column, scaled to the loudest column), the primitive a waveform view or a silence detector is built on.
0.1.2 #
- Docs: sharpen the pub.dev description to lead with the value and the terms people search.
0.1.1 #
- Move the stb_vorbis and minimp3 attributions out of
LICENSEintoTHIRD_PARTY_NOTICES.md, soLICENSEis the plain MIT text that automated license detection recognises. The attributions themselves are unchanged and still ship with the package.
0.1.0 #
- Initial release.
- Ogg Vorbis decoding via stb_vorbis and MP3 decoding via minimp3, compiled from source with Dart build hooks.
decodeAudio,decodeOgg,decodeMp3,detectFormatandPcmAudio.encodeWavwrites decoded PCM to a 16-bit WAV.