From 52d1823f72245048aba332b38266970073638e0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:23:05 +0000 Subject: [PATCH] chore: version packages --- .changeset/v4-nitro-streaming.md | 34 ------------------ .../react-native-audio-analyzer/CHANGELOG.md | 36 +++++++++++++++++++ .../react-native-audio-analyzer/package.json | 2 +- 3 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 .changeset/v4-nitro-streaming.md create mode 100644 packages/react-native-audio-analyzer/CHANGELOG.md diff --git a/.changeset/v4-nitro-streaming.md b/.changeset/v4-nitro-streaming.md deleted file mode 100644 index 1eac470..0000000 --- a/.changeset/v4-nitro-streaming.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -'react-native-audio-analyzer': major ---- - -**v4: decode once, render many.** - -New API: - -- `analyzeAudio(source, options)` decodes a file once, on a background thread with bounded memory, and returns `Peaks`: min, max and RMS per bucket as `Float32Array`s. Options: `maxBuckets` (default 100 000) or an exact `framesPerBucket`, `splitChannels`, a `start`/`end` range, cancellation with `AbortSignal` and `onProgress`. -- `resample(peaks, bars, { metric, start, end, channel })` and `resampleMinMax(peaks, bars, options)` turn peaks into any number of bars over any time range without decoding again. RMS is weighted by frames; for peaks every bucket belongs to exactly one bar, so a transient is never lost or drawn twice. -- `peaksLevel(peaks, { metric, percentile })` computes a reference level over the whole file; `normalize` / `normalizeMinMax` scale values linearly or in decibels against it, so zooming never rescales the waveform. -- `waveformPath` builds SVG/Skia paths; `fitBars` computes how many bars fit. -- `useWaveform(source, options)` React hook: status, progress, cancellation on unmount or source change, `bars` as a plain array, display errors reported as state, and analysis options kept separate from display options. -- `waveformPresets.chat`, `.player` and `.editor`: plain option objects tuned for voice messages, scrubbers and precise views. -- `getAudioInfo(source)` returns format, sample rate, channel count and duration. -- `encodePeaks` / `decodePeaks` serialize peaks in a versioned, forward-compatible binary format (8, 16 or 32 bits per value). -- Sources can be file paths, `file://` URIs, `http(s)://` URLs (downloaded and cached), `{ uri, headers }` or `ArrayBuffer`s with encoded audio. -- `load(url, { headers })` shares concurrent downloads of the same URL and headers; `clearCache()` and `getCacheSize()`. Headers are never forwarded to another origin on redirects. - -Breaking changes: - -- `computeAmplitude` is removed. Use `resample(await analyzeAudio(source), n)` or `useWaveform`. -- The v3 example helpers (`scale`, `sample`, `robustScale`, `trimmedScale`) are replaced by `resample`, `normalize` and `peaksLevel`. -- `load()` only accepts `http://`/`https://` URLs. Files are cached by the full URL in the app's caches directory; non-2xx responses reject and are never cached; interrupted downloads no longer leave truncated files behind. Files cached by v3 are not reused; `clearCache()` removes them and `getCacheSize()` counts them. -- Requires `react-native-nitro-modules` `^0.37.1`. - -Fixes: - -- Analysis no longer drops the last frames when the container states a shorter duration than the decoder delivers: without an `end`, it reads to the end of the stream. -- Fractional or negative sample counts no longer read out of bounds or divide by zero. -- Android: the downloader has the no-argument constructor that Nitro's autolinking requires, and follows redirects between `http` and `https`. -- miniaudio is compiled with optimizations even in debug builds. Previously Android debug builds compiled it at -O0 (Gradle's `cppFlags` don't apply to C files), which made a 6-minute MP3 take ~10 s instead of ~0.2 s on an emulator; iOS Debug had the same issue. -- miniaudio updated to 0.11.25 and built decode-only (no playback/capture backends), which shrinks the native binary and drops the AVFoundation/OpenSL ES dependencies. -- New formats: OGG Vorbis on every platform (built-in, via stb_vorbis), and everything the operating system can decode through a platform decoder called directly from C++ — AAC/M4A on iOS and Android, ALAC/AIFF/CAF on iOS, Opus on Android. `getAudioInfo` reports the detected codec and which decoder was used. diff --git a/packages/react-native-audio-analyzer/CHANGELOG.md b/packages/react-native-audio-analyzer/CHANGELOG.md new file mode 100644 index 0000000..58c9a29 --- /dev/null +++ b/packages/react-native-audio-analyzer/CHANGELOG.md @@ -0,0 +1,36 @@ +# react-native-audio-analyzer + +## 4.0.0 + +### Major Changes + +- [`e3a7431`](https://github.com/exzos28/react-native-audio-analyzer/commit/e3a7431fa3baf61680b69a3cf1c64d1dd4531ba9) Thanks [@exzos28](https://github.com/exzos28)! - **v4: decode once, render many.** + + New API: + + - `analyzeAudio(source, options)` decodes a file once, on a background thread with bounded memory, and returns `Peaks`: min, max and RMS per bucket as `Float32Array`s. Options: `maxBuckets` (default 100 000) or an exact `framesPerBucket`, `splitChannels`, a `start`/`end` range, cancellation with `AbortSignal` and `onProgress`. + - `resample(peaks, bars, { metric, start, end, channel })` and `resampleMinMax(peaks, bars, options)` turn peaks into any number of bars over any time range without decoding again. RMS is weighted by frames; for peaks every bucket belongs to exactly one bar, so a transient is never lost or drawn twice. + - `peaksLevel(peaks, { metric, percentile })` computes a reference level over the whole file; `normalize` / `normalizeMinMax` scale values linearly or in decibels against it, so zooming never rescales the waveform. + - `waveformPath` builds SVG/Skia paths; `fitBars` computes how many bars fit. + - `useWaveform(source, options)` React hook: status, progress, cancellation on unmount or source change, `bars` as a plain array, display errors reported as state, and analysis options kept separate from display options. + - `waveformPresets.chat`, `.player` and `.editor`: plain option objects tuned for voice messages, scrubbers and precise views. + - `getAudioInfo(source)` returns format, sample rate, channel count and duration. + - `encodePeaks` / `decodePeaks` serialize peaks in a versioned, forward-compatible binary format (8, 16 or 32 bits per value). + - Sources can be file paths, `file://` URIs, `http(s)://` URLs (downloaded and cached), `{ uri, headers }` or `ArrayBuffer`s with encoded audio. + - `load(url, { headers })` shares concurrent downloads of the same URL and headers; `clearCache()` and `getCacheSize()`. Headers are never forwarded to another origin on redirects. + + Breaking changes: + + - `computeAmplitude` is removed. Use `resample(await analyzeAudio(source), n)` or `useWaveform`. + - The v3 example helpers (`scale`, `sample`, `robustScale`, `trimmedScale`) are replaced by `resample`, `normalize` and `peaksLevel`. + - `load()` only accepts `http://`/`https://` URLs. Files are cached by the full URL in the app's caches directory; non-2xx responses reject and are never cached; interrupted downloads no longer leave truncated files behind. Files cached by v3 are not reused; `clearCache()` removes them and `getCacheSize()` counts them. + - Requires `react-native-nitro-modules` `^0.37.1`. + + Fixes: + + - Analysis no longer drops the last frames when the container states a shorter duration than the decoder delivers: without an `end`, it reads to the end of the stream. + - Fractional or negative sample counts no longer read out of bounds or divide by zero. + - Android: the downloader has the no-argument constructor that Nitro's autolinking requires, and follows redirects between `http` and `https`. + - miniaudio is compiled with optimizations even in debug builds. Previously Android debug builds compiled it at -O0 (Gradle's `cppFlags` don't apply to C files), which made a 6-minute MP3 take ~10 s instead of ~0.2 s on an emulator; iOS Debug had the same issue. + - miniaudio updated to 0.11.25 and built decode-only (no playback/capture backends), which shrinks the native binary and drops the AVFoundation/OpenSL ES dependencies. + - New formats: OGG Vorbis on every platform (built-in, via stb_vorbis), and everything the operating system can decode through a platform decoder called directly from C++ — AAC/M4A on iOS and Android, ALAC/AIFF/CAF on iOS, Opus on Android. `getAudioInfo` reports the detected codec and which decoder was used. diff --git a/packages/react-native-audio-analyzer/package.json b/packages/react-native-audio-analyzer/package.json index 4148936..04cffc1 100644 --- a/packages/react-native-audio-analyzer/package.json +++ b/packages/react-native-audio-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "react-native-audio-analyzer", - "version": "3.1.0", + "version": "4.0.0", "description": "Fast native audio waveform and amplitude extraction for React Native, powered by Nitro Modules and miniaudio.", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts",