Skip to content

v0.8.0

Choose a tag to compare

@sjoenk sjoenk released this 30 Apr 23:04
· 14 commits to main since this release

v0.8.0

Cross-track loudness option

Added a new WaveformNormalization enum that lets callers opt into absolute amplitude scaling on getWaveform and getWaveformBytes. The default behavior is unchanged, so this release is non-breaking.

  • WaveformNormalization.perFile (default) — each waveform is rescaled so its loudest window equals 1.0. Best for single-track UI: voice memos, podcast previews, chat voice messages.
  • WaveformNormalization.absolute — amplitudes are scaled against the maximum signed 16-bit PCM magnitude (32768), so absolute loudness is preserved across files. Best for music apps that show several tracks side by side, where a quiet recording should visibly look quieter.
final waveform = await AudioDecoder.getWaveform(
  '/path/to/song.mp3',
  numberOfSamples: 100,
  normalization: WaveformNormalization.absolute,
);

Implemented across all platforms: Android, iOS/macOS, Linux, Windows, and Web. numberOfSamples is now also validated up front (> 0, throws ArgumentError otherwise).

Cross-platform build fixes

Resolves build failures on newer compilers, contributed by @navidicted:

  • Linux: Forward typedefs for G_DEFINE_TYPE so the plugin compiles with GCC 15.2.1.
  • Windows: Parenthesize std::min / std::max to avoid the MSVC min/max macro clash, cast MF_SOURCE_READER_MEDIASOURCE to DWORD, include <cctype> and <flutter/encodable_value.h>, and fix a std::tolower data-loss warning.

PRs included

  • Fix build failures on Linux and Windows by @navidicted in #42
  • Add WaveformNormalization option for cross-track loudness by @sjoenk in #43

New Contributors

  • @navidicted made their first contribution in #42 — thanks for fixing the GCC 15 + MSVC build issues!

Full Changelog: v0.7.4...v0.8.0