strata-react 1.3.9 → 1.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,16 @@ export declare function toPeakPair(peaks: WaveformPeaks): PeakPair;
14
14
  export declare function peaksBetween(pair: PeakPair, from: number, to: number): [number, number];
15
15
  /** Resamples peaks to `buckets` entries: each is the lowest and highest of the entries it covers. Any length in, any length out. */
16
16
  export declare function resamplePeaks(peaks: WaveformPeaks, buckets: number): PeakPair;
17
+ /**
18
+ * How much to scale peaks so the loud parts fill the height: one over the `percentile` of the slices'
19
+ * largest magnitudes, at most `maxGain` and never below 1. A percentile rather than the loudest slice,
20
+ * so one thump or click on a quiet recording (a dropped camcorder, a tape splice) does not keep the rest
21
+ * flat; a ceiling, so a recording that is only hiss is not drawn as if it were speech.
22
+ */
23
+ export declare function peakGain(pair: PeakPair, { percentile, maxGain }?: {
24
+ percentile?: number;
25
+ maxGain?: number;
26
+ }): number;
17
27
  /** What a decoded file looks like to this code: the shape of the browser's `AudioBuffer`. */
18
28
  export type DecodedAudio = {
19
29
  duration: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-react",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
5
5
  "repository": {
6
6
  "type": "git",