@codexo/exojs-audio-fx 0.14.0-next.0
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.
- package/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/esm/AudioAnalyser.d.ts +124 -0
- package/dist/esm/AudioAnalyser.js +472 -0
- package/dist/esm/AudioAnalyser.js.map +1 -0
- package/dist/esm/BeatDetector.d.ts +203 -0
- package/dist/esm/BeatDetector.js +422 -0
- package/dist/esm/BeatDetector.js.map +1 -0
- package/dist/esm/dsp/fft.d.ts +22 -0
- package/dist/esm/dsp/mel.d.ts +43 -0
- package/dist/esm/dsp/mel.js +70 -0
- package/dist/esm/dsp/mel.js.map +1 -0
- package/dist/esm/dsp/tempogram.d.ts +51 -0
- package/dist/esm/effects/ChorusEffect.d.ts +53 -0
- package/dist/esm/effects/ChorusEffect.js +154 -0
- package/dist/esm/effects/ChorusEffect.js.map +1 -0
- package/dist/esm/effects/CompressorEffect.d.ts +53 -0
- package/dist/esm/effects/CompressorEffect.js +122 -0
- package/dist/esm/effects/CompressorEffect.js.map +1 -0
- package/dist/esm/effects/DelayEffect.d.ts +35 -0
- package/dist/esm/effects/DelayEffect.js +113 -0
- package/dist/esm/effects/DelayEffect.js.map +1 -0
- package/dist/esm/effects/DuckingEffect.d.ts +43 -0
- package/dist/esm/effects/DuckingEffect.js +172 -0
- package/dist/esm/effects/DuckingEffect.js.map +1 -0
- package/dist/esm/effects/EqualizerEffect.d.ts +50 -0
- package/dist/esm/effects/EqualizerEffect.js +137 -0
- package/dist/esm/effects/EqualizerEffect.js.map +1 -0
- package/dist/esm/effects/GranularEffect.d.ts +62 -0
- package/dist/esm/effects/GranularEffect.js +107 -0
- package/dist/esm/effects/GranularEffect.js.map +1 -0
- package/dist/esm/effects/PitchShiftEffect.d.ts +44 -0
- package/dist/esm/effects/PitchShiftEffect.js +66 -0
- package/dist/esm/effects/PitchShiftEffect.js.map +1 -0
- package/dist/esm/effects/ReverbEffect.d.ts +37 -0
- package/dist/esm/effects/ReverbEffect.js +121 -0
- package/dist/esm/effects/ReverbEffect.js.map +1 -0
- package/dist/esm/effects/VocoderEffect.d.ts +48 -0
- package/dist/esm/effects/VocoderEffect.js +94 -0
- package/dist/esm/effects/VocoderEffect.js.map +1 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/worklets/beat-detector.worklet.d.ts +1 -0
- package/dist/esm/worklets/beat-detector.worklet.js +647 -0
- package/dist/esm/worklets/beat-detector.worklet.js.map +1 -0
- package/dist/esm/worklets/granular.worklet.d.ts +1 -0
- package/dist/esm/worklets/granular.worklet.js +89 -0
- package/dist/esm/worklets/granular.worklet.js.map +1 -0
- package/dist/esm/worklets/pitch-shift.worklet.d.ts +1 -0
- package/dist/esm/worklets/pitch-shift.worklet.js +74 -0
- package/dist/esm/worklets/pitch-shift.worklet.js.map +1 -0
- package/dist/esm/worklets/vocoder.worklet.d.ts +1 -0
- package/dist/esm/worklets/vocoder.worklet.js +92 -0
- package/dist/esm/worklets/vocoder.worklet.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Codexo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @codexo/exojs-audio-fx
|
|
2
|
+
|
|
3
|
+
Audio effects, DSP, beat detection, and analysis for [ExoJS](https://github.com/Exoridus/ExoJS).
|
|
4
|
+
|
|
5
|
+
A peer-dependency library on top of `@codexo/exojs`. Core ships the audio engine
|
|
6
|
+
(buses, voices, the `AudioEffect`/`WorkletEffect` bases, and the native
|
|
7
|
+
`BiquadEffect`); this package adds the richer effects plus analysis tooling:
|
|
8
|
+
|
|
9
|
+
- **Effects** — `ReverbEffect`, `DelayEffect`, `ChorusEffect`, `CompressorEffect`,
|
|
10
|
+
`EqualizerEffect`, `GranularEffect`, `PitchShiftEffect`, `VocoderEffect`,
|
|
11
|
+
`DuckingEffect`. Insert on a bus (`bus.addEffect(fx)`) or a voice
|
|
12
|
+
(`voice.addEffect(fx)`).
|
|
13
|
+
- **Analysis** — `AudioAnalyser` (spectrum / waveform / mel-log mapping) and
|
|
14
|
+
`BeatDetector` (real-time tempo + beat tracking).
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { ReverbEffect, AudioAnalyser } from '@codexo/exojs-audio-fx';
|
|
18
|
+
|
|
19
|
+
app.audio.music.addEffect(new ReverbEffect({ wet: 0.4 }));
|
|
20
|
+
const analyser = new AudioAnalyser({ source: app.audio.music });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { type AudioBus, type Voice } from '@codexo/exojs';
|
|
2
|
+
export type AudioAnalyserSource = AudioBus | Voice | MediaStream | AudioNode | null;
|
|
3
|
+
/** Construction options for {@link AudioAnalyser}. */
|
|
4
|
+
export interface AudioAnalyserOptions {
|
|
5
|
+
/** FFT window size; must be a power of two between 32 and 32768. Default 2048. */
|
|
6
|
+
fftSize?: number;
|
|
7
|
+
/** Time-domain smoothing constant in 0..1 applied between successive analyses. Default 0.8. */
|
|
8
|
+
smoothingTimeConstant?: number;
|
|
9
|
+
/** Minimum dBFS rendered by the byte-domain spectrum getters. Default -100. */
|
|
10
|
+
minDecibels?: number;
|
|
11
|
+
/** Maximum dBFS rendered by the byte-domain spectrum getters. Default -30. */
|
|
12
|
+
maxDecibels?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Optional initial source. Equivalent to `analyser.source = value` after
|
|
15
|
+
* construction; provided for ergonomic one-shot construction. The setter
|
|
16
|
+
* remains usable for runtime source switches.
|
|
17
|
+
*/
|
|
18
|
+
source?: AudioAnalyserSource;
|
|
19
|
+
}
|
|
20
|
+
/** Mapping options for {@link AudioAnalyser.getSpectrumMel} and {@link AudioAnalyser.getSpectrumLog}. */
|
|
21
|
+
export interface SpectrumMappingOptions {
|
|
22
|
+
/** Number of output bands. Default 32. */
|
|
23
|
+
bands?: number;
|
|
24
|
+
/** Lower frequency bound in Hz. Default 20. */
|
|
25
|
+
fMin?: number;
|
|
26
|
+
/** Upper frequency bound in Hz. Default 20000 (clamped to nyquist at runtime). */
|
|
27
|
+
fMax?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Lightweight visualisation analyser backed by a Web Audio AnalyserNode.
|
|
31
|
+
*
|
|
32
|
+
* Accepts any of: AudioBus, Voice, MediaStream, AudioNode, or null. The tap is
|
|
33
|
+
* a parallel branch — it does not affect the source's main routing. Tap a bus
|
|
34
|
+
* for a whole submix, or an individual {@link Voice} (its `output` node) for a
|
|
35
|
+
* single playing instance.
|
|
36
|
+
*/
|
|
37
|
+
export declare class AudioAnalyser {
|
|
38
|
+
private _analyser;
|
|
39
|
+
private readonly _options;
|
|
40
|
+
private _source;
|
|
41
|
+
private _tapSource;
|
|
42
|
+
private _streamSource;
|
|
43
|
+
private _pendingSourceSetup;
|
|
44
|
+
private readonly _onAudioContextReady;
|
|
45
|
+
private _byteSpectrum;
|
|
46
|
+
private _floatSpectrum;
|
|
47
|
+
private _byteWaveform;
|
|
48
|
+
private _floatWaveform;
|
|
49
|
+
private _melCache;
|
|
50
|
+
private _logCache;
|
|
51
|
+
/**
|
|
52
|
+
* Create an `AudioAnalyser` with the given options. The underlying
|
|
53
|
+
* `AnalyserNode` is created immediately if the `AudioContext` is already
|
|
54
|
+
* running, or deferred until {@link onAudioContextReady} fires.
|
|
55
|
+
*/
|
|
56
|
+
constructor(options?: AudioAnalyserOptions);
|
|
57
|
+
/**
|
|
58
|
+
* The currently tapped audio source, or `null` if none is set.
|
|
59
|
+
* Assigning a new value disconnects the previous tap and connects the new
|
|
60
|
+
* source as a parallel branch without affecting the source's main routing.
|
|
61
|
+
*/
|
|
62
|
+
get source(): AudioAnalyserSource;
|
|
63
|
+
set source(value: AudioAnalyserSource);
|
|
64
|
+
get fftSize(): number;
|
|
65
|
+
/** Number of frequency bins available — half of `fftSize`. */
|
|
66
|
+
get frequencyBinCount(): number;
|
|
67
|
+
get smoothingTimeConstant(): number;
|
|
68
|
+
set smoothingTimeConstant(v: number);
|
|
69
|
+
get minDecibels(): number;
|
|
70
|
+
set minDecibels(v: number);
|
|
71
|
+
get maxDecibels(): number;
|
|
72
|
+
set maxDecibels(v: number);
|
|
73
|
+
/** Fill and return the byte frequency spectrum (0..255 per bin). */
|
|
74
|
+
getSpectrum(into?: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
75
|
+
/** Fill and return the float frequency spectrum (dB per bin). */
|
|
76
|
+
getSpectrumFloat(into?: Float32Array<ArrayBuffer>): Float32Array<ArrayBuffer>;
|
|
77
|
+
/** Fill and return the byte time-domain waveform (0..255 per sample). */
|
|
78
|
+
getWaveform(into?: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
79
|
+
/** Fill and return the float time-domain waveform (-1..1 per sample). */
|
|
80
|
+
getWaveformFloat(into?: Float32Array<ArrayBuffer>): Float32Array<ArrayBuffer>;
|
|
81
|
+
/**
|
|
82
|
+
* Return the mean energy of frequency bins in the given Hz range, normalised 0..1.
|
|
83
|
+
* Uses the byte spectrum (0..255), normalised by dividing by 255.
|
|
84
|
+
*/
|
|
85
|
+
getBandEnergy(fromHz: number, toHz: number): number;
|
|
86
|
+
/** Return low (0-250 Hz), mid (250-2 kHz), and high (2 k-20 kHz) band energies (0..1 each). */
|
|
87
|
+
getLowMidHigh(): {
|
|
88
|
+
low: number;
|
|
89
|
+
mid: number;
|
|
90
|
+
high: number;
|
|
91
|
+
};
|
|
92
|
+
/** Return overall RMS energy across all bins, normalised 0..1. */
|
|
93
|
+
getRms(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Mel-scaled spectrum, byte domain (0..255). Output length = `bands`.
|
|
96
|
+
* Each output bin is a triangular-weighted sum of the linear FFT bins
|
|
97
|
+
* underneath it, mel-spaced from `fMin` to `fMax`.
|
|
98
|
+
*/
|
|
99
|
+
getSpectrumMel(into?: Uint8Array<ArrayBuffer>, options?: SpectrumMappingOptions): Uint8Array<ArrayBuffer>;
|
|
100
|
+
/** Mel-scaled spectrum, float domain (dBFS values). Output length = `bands`. */
|
|
101
|
+
getSpectrumMelFloat(into?: Float32Array<ArrayBuffer>, options?: SpectrumMappingOptions): Float32Array<ArrayBuffer>;
|
|
102
|
+
/**
|
|
103
|
+
* Log-scaled spectrum, byte domain (0..255). Output length = `bands`.
|
|
104
|
+
* Bins are spaced so each output covers an equal fraction of the
|
|
105
|
+
* `log2(fMax / fMin)` octave range — useful when you want a
|
|
106
|
+
* frequency-axis visualization where each octave gets the same width.
|
|
107
|
+
*/
|
|
108
|
+
getSpectrumLog(into?: Uint8Array<ArrayBuffer>, options?: SpectrumMappingOptions): Uint8Array<ArrayBuffer>;
|
|
109
|
+
/** Log-scaled spectrum, float domain (dBFS values). Output length = `bands`. */
|
|
110
|
+
getSpectrumLogFloat(into?: Float32Array<ArrayBuffer>, options?: SpectrumMappingOptions): Float32Array<ArrayBuffer>;
|
|
111
|
+
/**
|
|
112
|
+
* Disconnect the analyser tap, release the internal `AnalyserNode`, and
|
|
113
|
+
* cancel any pending setup callbacks. Call when the analyser is no longer
|
|
114
|
+
* needed to avoid memory leaks.
|
|
115
|
+
*/
|
|
116
|
+
destroy(): void;
|
|
117
|
+
private _getMelFilterbank;
|
|
118
|
+
private _getLogRanges;
|
|
119
|
+
private _setupAnalyser;
|
|
120
|
+
private _connectSource;
|
|
121
|
+
private _resolveToAudioNode;
|
|
122
|
+
private _deferConnectionViaBus;
|
|
123
|
+
private _disconnectTap;
|
|
124
|
+
}
|
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import { onAudioContextReady, isAudioContextReady, getAudioContext } from '@codexo/exojs';
|
|
2
|
+
import { buildMelFilterbank } from './dsp/mel.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Lightweight visualisation analyser backed by a Web Audio AnalyserNode.
|
|
6
|
+
*
|
|
7
|
+
* Accepts any of: AudioBus, Voice, MediaStream, AudioNode, or null. The tap is
|
|
8
|
+
* a parallel branch — it does not affect the source's main routing. Tap a bus
|
|
9
|
+
* for a whole submix, or an individual {@link Voice} (its `output` node) for a
|
|
10
|
+
* single playing instance.
|
|
11
|
+
*/
|
|
12
|
+
class AudioAnalyser {
|
|
13
|
+
_analyser = null;
|
|
14
|
+
_options;
|
|
15
|
+
_source = null;
|
|
16
|
+
_tapSource = null;
|
|
17
|
+
_streamSource = null;
|
|
18
|
+
_pendingSourceSetup = null;
|
|
19
|
+
_onAudioContextReady = (ctx) => {
|
|
20
|
+
onAudioContextReady.remove(this._onAudioContextReady);
|
|
21
|
+
this._setupAnalyser(ctx);
|
|
22
|
+
};
|
|
23
|
+
// Pre-allocated buffers
|
|
24
|
+
_byteSpectrum;
|
|
25
|
+
_floatSpectrum;
|
|
26
|
+
_byteWaveform;
|
|
27
|
+
_floatWaveform;
|
|
28
|
+
// Cached mel/log filterbanks. Key: `${bands}|${fMin}|${fMax}|${fftSize}`.
|
|
29
|
+
// Filterbank construction is non-trivial; caching avoids per-frame allocation.
|
|
30
|
+
_melCache = new Map();
|
|
31
|
+
_logCache = new Map();
|
|
32
|
+
/**
|
|
33
|
+
* Create an `AudioAnalyser` with the given options. The underlying
|
|
34
|
+
* `AnalyserNode` is created immediately if the `AudioContext` is already
|
|
35
|
+
* running, or deferred until {@link onAudioContextReady} fires.
|
|
36
|
+
*/
|
|
37
|
+
constructor(options) {
|
|
38
|
+
this._options = {
|
|
39
|
+
fftSize: options?.fftSize ?? 2048,
|
|
40
|
+
smoothingTimeConstant: options?.smoothingTimeConstant ?? 0.8,
|
|
41
|
+
minDecibels: options?.minDecibels ?? -100,
|
|
42
|
+
maxDecibels: options?.maxDecibels ?? -30,
|
|
43
|
+
source: options?.source ?? null,
|
|
44
|
+
};
|
|
45
|
+
const binCount = this._options.fftSize >> 1;
|
|
46
|
+
this._byteSpectrum = new Uint8Array(binCount);
|
|
47
|
+
this._floatSpectrum = new Float32Array(binCount);
|
|
48
|
+
this._byteWaveform = new Uint8Array(binCount);
|
|
49
|
+
this._floatWaveform = new Float32Array(binCount);
|
|
50
|
+
if (isAudioContextReady()) {
|
|
51
|
+
this._setupAnalyser(getAudioContext());
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
onAudioContextReady.add(this._onAudioContextReady);
|
|
55
|
+
}
|
|
56
|
+
if (options?.source !== undefined && options.source !== null) {
|
|
57
|
+
this.source = options.source;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// -----------------------------------------------------------------------
|
|
61
|
+
// Source setter
|
|
62
|
+
// -----------------------------------------------------------------------
|
|
63
|
+
/**
|
|
64
|
+
* The currently tapped audio source, or `null` if none is set.
|
|
65
|
+
* Assigning a new value disconnects the previous tap and connects the new
|
|
66
|
+
* source as a parallel branch without affecting the source's main routing.
|
|
67
|
+
*/
|
|
68
|
+
get source() {
|
|
69
|
+
return this._source;
|
|
70
|
+
}
|
|
71
|
+
set source(value) {
|
|
72
|
+
if (value === this._source)
|
|
73
|
+
return;
|
|
74
|
+
// 1. Disconnect current tap
|
|
75
|
+
this._disconnectTap();
|
|
76
|
+
this._source = value;
|
|
77
|
+
if (value === null)
|
|
78
|
+
return;
|
|
79
|
+
// 2. Resolve and connect new tap
|
|
80
|
+
if (isAudioContextReady()) {
|
|
81
|
+
this._pendingSourceSetup = null;
|
|
82
|
+
this._connectSource(value, getAudioContext());
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (this._pendingSourceSetup !== null) {
|
|
86
|
+
onAudioContextReady.remove(this._pendingSourceSetup);
|
|
87
|
+
}
|
|
88
|
+
const handler = (ctx) => {
|
|
89
|
+
onAudioContextReady.remove(handler);
|
|
90
|
+
this._pendingSourceSetup = null;
|
|
91
|
+
this._connectSource(value, ctx);
|
|
92
|
+
};
|
|
93
|
+
this._pendingSourceSetup = handler;
|
|
94
|
+
onAudioContextReady.add(handler);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// -----------------------------------------------------------------------
|
|
98
|
+
// AnalyserNode property pass-throughs
|
|
99
|
+
// -----------------------------------------------------------------------
|
|
100
|
+
get fftSize() {
|
|
101
|
+
return this._options.fftSize;
|
|
102
|
+
}
|
|
103
|
+
/** Number of frequency bins available — half of `fftSize`. */
|
|
104
|
+
get frequencyBinCount() {
|
|
105
|
+
return this._options.fftSize >> 1;
|
|
106
|
+
}
|
|
107
|
+
get smoothingTimeConstant() {
|
|
108
|
+
return this._analyser?.smoothingTimeConstant ?? this._options.smoothingTimeConstant;
|
|
109
|
+
}
|
|
110
|
+
set smoothingTimeConstant(v) {
|
|
111
|
+
this._options.smoothingTimeConstant = v;
|
|
112
|
+
if (this._analyser)
|
|
113
|
+
this._analyser.smoothingTimeConstant = v;
|
|
114
|
+
}
|
|
115
|
+
get minDecibels() {
|
|
116
|
+
return this._analyser?.minDecibels ?? this._options.minDecibels;
|
|
117
|
+
}
|
|
118
|
+
set minDecibels(v) {
|
|
119
|
+
this._options.minDecibels = v;
|
|
120
|
+
if (this._analyser)
|
|
121
|
+
this._analyser.minDecibels = v;
|
|
122
|
+
}
|
|
123
|
+
get maxDecibels() {
|
|
124
|
+
return this._analyser?.maxDecibels ?? this._options.maxDecibels;
|
|
125
|
+
}
|
|
126
|
+
set maxDecibels(v) {
|
|
127
|
+
this._options.maxDecibels = v;
|
|
128
|
+
if (this._analyser)
|
|
129
|
+
this._analyser.maxDecibels = v;
|
|
130
|
+
}
|
|
131
|
+
// -----------------------------------------------------------------------
|
|
132
|
+
// Raw data
|
|
133
|
+
// -----------------------------------------------------------------------
|
|
134
|
+
/** Fill and return the byte frequency spectrum (0..255 per bin). */
|
|
135
|
+
getSpectrum(into) {
|
|
136
|
+
const buf = into ?? this._byteSpectrum;
|
|
137
|
+
if (this._analyser) {
|
|
138
|
+
this._analyser.getByteFrequencyData(buf);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
buf.fill(0);
|
|
142
|
+
}
|
|
143
|
+
return buf;
|
|
144
|
+
}
|
|
145
|
+
/** Fill and return the float frequency spectrum (dB per bin). */
|
|
146
|
+
getSpectrumFloat(into) {
|
|
147
|
+
const buf = into ?? this._floatSpectrum;
|
|
148
|
+
if (this._analyser) {
|
|
149
|
+
this._analyser.getFloatFrequencyData(buf);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
buf.fill(0);
|
|
153
|
+
}
|
|
154
|
+
return buf;
|
|
155
|
+
}
|
|
156
|
+
/** Fill and return the byte time-domain waveform (0..255 per sample). */
|
|
157
|
+
getWaveform(into) {
|
|
158
|
+
const buf = into ?? this._byteWaveform;
|
|
159
|
+
if (this._analyser) {
|
|
160
|
+
this._analyser.getByteTimeDomainData(buf);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
buf.fill(0);
|
|
164
|
+
}
|
|
165
|
+
return buf;
|
|
166
|
+
}
|
|
167
|
+
/** Fill and return the float time-domain waveform (-1..1 per sample). */
|
|
168
|
+
getWaveformFloat(into) {
|
|
169
|
+
const buf = into ?? this._floatWaveform;
|
|
170
|
+
if (this._analyser) {
|
|
171
|
+
this._analyser.getFloatTimeDomainData(buf);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
buf.fill(0);
|
|
175
|
+
}
|
|
176
|
+
return buf;
|
|
177
|
+
}
|
|
178
|
+
// -----------------------------------------------------------------------
|
|
179
|
+
// Convenience helpers
|
|
180
|
+
// -----------------------------------------------------------------------
|
|
181
|
+
/**
|
|
182
|
+
* Return the mean energy of frequency bins in the given Hz range, normalised 0..1.
|
|
183
|
+
* Uses the byte spectrum (0..255), normalised by dividing by 255.
|
|
184
|
+
*/
|
|
185
|
+
getBandEnergy(fromHz, toHz) {
|
|
186
|
+
if (!this._analyser)
|
|
187
|
+
return 0;
|
|
188
|
+
const ctx = getAudioContext();
|
|
189
|
+
const nyquist = ctx.sampleRate / 2;
|
|
190
|
+
const binCount = this.frequencyBinCount;
|
|
191
|
+
const fromBin = Math.max(0, Math.min(binCount - 1, Math.round((fromHz / nyquist) * binCount)));
|
|
192
|
+
const toBin = Math.max(0, Math.min(binCount - 1, Math.round((toHz / nyquist) * binCount)));
|
|
193
|
+
const lo = Math.min(fromBin, toBin);
|
|
194
|
+
const hi = Math.max(fromBin, toBin);
|
|
195
|
+
const spectrum = this.getSpectrum();
|
|
196
|
+
let sum = 0;
|
|
197
|
+
const count = hi - lo + 1;
|
|
198
|
+
for (let i = lo; i <= hi; i++) {
|
|
199
|
+
sum += spectrum[i];
|
|
200
|
+
}
|
|
201
|
+
return sum / (count * 255);
|
|
202
|
+
}
|
|
203
|
+
/** Return low (0-250 Hz), mid (250-2 kHz), and high (2 k-20 kHz) band energies (0..1 each). */
|
|
204
|
+
getLowMidHigh() {
|
|
205
|
+
return {
|
|
206
|
+
low: this.getBandEnergy(0, 250),
|
|
207
|
+
mid: this.getBandEnergy(250, 2000),
|
|
208
|
+
high: this.getBandEnergy(2000, 20000),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/** Return overall RMS energy across all bins, normalised 0..1. */
|
|
212
|
+
getRms() {
|
|
213
|
+
if (!this._analyser)
|
|
214
|
+
return 0;
|
|
215
|
+
const ctx = getAudioContext();
|
|
216
|
+
const nyquist = ctx.sampleRate / 2;
|
|
217
|
+
return this.getBandEnergy(0, nyquist);
|
|
218
|
+
}
|
|
219
|
+
// -----------------------------------------------------------------------
|
|
220
|
+
// Spectrum mapping (mel / log scaling)
|
|
221
|
+
//
|
|
222
|
+
// The raw FFT bins from AnalyserNode are linearly distributed across
|
|
223
|
+
// 0..nyquist, which gives bass a few bins and treble hundreds. For
|
|
224
|
+
// visualisations you typically want perceptually-weighted spacing.
|
|
225
|
+
//
|
|
226
|
+
// Both `getSpectrumMel` and `getSpectrumLog` operate on the byte-domain
|
|
227
|
+
// spectrum (0..255) and produce byte output by default. The float
|
|
228
|
+
// variants operate on dBFS values and produce float output.
|
|
229
|
+
//
|
|
230
|
+
// Filterbanks are cached on the analyser; they only rebuild when fftSize
|
|
231
|
+
// or the (bands, fMin, fMax) parameters change.
|
|
232
|
+
// -----------------------------------------------------------------------
|
|
233
|
+
/**
|
|
234
|
+
* Mel-scaled spectrum, byte domain (0..255). Output length = `bands`.
|
|
235
|
+
* Each output bin is a triangular-weighted sum of the linear FFT bins
|
|
236
|
+
* underneath it, mel-spaced from `fMin` to `fMax`.
|
|
237
|
+
*/
|
|
238
|
+
getSpectrumMel(into, options) {
|
|
239
|
+
const bandCount = options?.bands ?? 32;
|
|
240
|
+
const out = into ?? new Uint8Array(bandCount);
|
|
241
|
+
const filterbank = this._getMelFilterbank(bandCount, options?.fMin ?? 20, options?.fMax ?? 20000);
|
|
242
|
+
if (!this._analyser || filterbank === null) {
|
|
243
|
+
out.fill(0);
|
|
244
|
+
return out;
|
|
245
|
+
}
|
|
246
|
+
this._analyser.getByteFrequencyData(this._byteSpectrum);
|
|
247
|
+
applyFilterbank(this._byteSpectrum, filterbank, out);
|
|
248
|
+
return out;
|
|
249
|
+
}
|
|
250
|
+
/** Mel-scaled spectrum, float domain (dBFS values). Output length = `bands`. */
|
|
251
|
+
getSpectrumMelFloat(into, options) {
|
|
252
|
+
const bandCount = options?.bands ?? 32;
|
|
253
|
+
const out = into ?? new Float32Array(bandCount);
|
|
254
|
+
const filterbank = this._getMelFilterbank(bandCount, options?.fMin ?? 20, options?.fMax ?? 20000);
|
|
255
|
+
if (!this._analyser || filterbank === null) {
|
|
256
|
+
out.fill(0);
|
|
257
|
+
return out;
|
|
258
|
+
}
|
|
259
|
+
this._analyser.getFloatFrequencyData(this._floatSpectrum);
|
|
260
|
+
applyFilterbank(this._floatSpectrum, filterbank, out);
|
|
261
|
+
return out;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Log-scaled spectrum, byte domain (0..255). Output length = `bands`.
|
|
265
|
+
* Bins are spaced so each output covers an equal fraction of the
|
|
266
|
+
* `log2(fMax / fMin)` octave range — useful when you want a
|
|
267
|
+
* frequency-axis visualization where each octave gets the same width.
|
|
268
|
+
*/
|
|
269
|
+
getSpectrumLog(into, options) {
|
|
270
|
+
const bandCount = options?.bands ?? 32;
|
|
271
|
+
const out = into ?? new Uint8Array(bandCount);
|
|
272
|
+
const ranges = this._getLogRanges(bandCount, options?.fMin ?? 20, options?.fMax ?? 20000);
|
|
273
|
+
if (!this._analyser || ranges === null) {
|
|
274
|
+
out.fill(0);
|
|
275
|
+
return out;
|
|
276
|
+
}
|
|
277
|
+
this._analyser.getByteFrequencyData(this._byteSpectrum);
|
|
278
|
+
applyLogRanges(this._byteSpectrum, ranges, out);
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
281
|
+
/** Log-scaled spectrum, float domain (dBFS values). Output length = `bands`. */
|
|
282
|
+
getSpectrumLogFloat(into, options) {
|
|
283
|
+
const bandCount = options?.bands ?? 32;
|
|
284
|
+
const out = into ?? new Float32Array(bandCount);
|
|
285
|
+
const ranges = this._getLogRanges(bandCount, options?.fMin ?? 20, options?.fMax ?? 20000);
|
|
286
|
+
if (!this._analyser || ranges === null) {
|
|
287
|
+
out.fill(0);
|
|
288
|
+
return out;
|
|
289
|
+
}
|
|
290
|
+
this._analyser.getFloatFrequencyData(this._floatSpectrum);
|
|
291
|
+
applyLogRanges(this._floatSpectrum, ranges, out);
|
|
292
|
+
return out;
|
|
293
|
+
}
|
|
294
|
+
// -----------------------------------------------------------------------
|
|
295
|
+
// Lifecycle
|
|
296
|
+
// -----------------------------------------------------------------------
|
|
297
|
+
/**
|
|
298
|
+
* Disconnect the analyser tap, release the internal `AnalyserNode`, and
|
|
299
|
+
* cancel any pending setup callbacks. Call when the analyser is no longer
|
|
300
|
+
* needed to avoid memory leaks.
|
|
301
|
+
*/
|
|
302
|
+
destroy() {
|
|
303
|
+
onAudioContextReady.remove(this._onAudioContextReady);
|
|
304
|
+
if (this._pendingSourceSetup !== null) {
|
|
305
|
+
onAudioContextReady.remove(this._pendingSourceSetup);
|
|
306
|
+
this._pendingSourceSetup = null;
|
|
307
|
+
}
|
|
308
|
+
this._disconnectTap();
|
|
309
|
+
this._analyser?.disconnect();
|
|
310
|
+
this._analyser = null;
|
|
311
|
+
this._source = null;
|
|
312
|
+
}
|
|
313
|
+
// -----------------------------------------------------------------------
|
|
314
|
+
// Private helpers
|
|
315
|
+
// -----------------------------------------------------------------------
|
|
316
|
+
_getMelFilterbank(bands, fMin, fMax) {
|
|
317
|
+
if (!this._analyser)
|
|
318
|
+
return null;
|
|
319
|
+
const ctx = getAudioContext();
|
|
320
|
+
const fftSize = this._options.fftSize;
|
|
321
|
+
const clampedFmax = Math.min(fMax, ctx.sampleRate / 2);
|
|
322
|
+
const key = `${bands}|${fMin}|${clampedFmax}|${fftSize}`;
|
|
323
|
+
let cached = this._melCache.get(key);
|
|
324
|
+
if (cached === undefined) {
|
|
325
|
+
cached = buildMelFilterbank(bands, fMin, clampedFmax, fftSize, ctx.sampleRate);
|
|
326
|
+
this._melCache.set(key, cached);
|
|
327
|
+
}
|
|
328
|
+
return cached;
|
|
329
|
+
}
|
|
330
|
+
_getLogRanges(bands, fMin, fMax) {
|
|
331
|
+
if (!this._analyser)
|
|
332
|
+
return null;
|
|
333
|
+
const ctx = getAudioContext();
|
|
334
|
+
const fftSize = this._options.fftSize;
|
|
335
|
+
const clampedFmax = Math.min(fMax, ctx.sampleRate / 2);
|
|
336
|
+
const key = `${bands}|${fMin}|${clampedFmax}|${fftSize}`;
|
|
337
|
+
let cached = this._logCache.get(key);
|
|
338
|
+
if (cached === undefined) {
|
|
339
|
+
cached = buildLogRanges(bands, fMin, clampedFmax, fftSize, ctx.sampleRate);
|
|
340
|
+
this._logCache.set(key, cached);
|
|
341
|
+
}
|
|
342
|
+
return cached;
|
|
343
|
+
}
|
|
344
|
+
_setupAnalyser(audioContext) {
|
|
345
|
+
const node = audioContext.createAnalyser();
|
|
346
|
+
node.fftSize = this._options.fftSize;
|
|
347
|
+
node.minDecibels = this._options.minDecibels;
|
|
348
|
+
node.maxDecibels = this._options.maxDecibels;
|
|
349
|
+
node.smoothingTimeConstant = this._options.smoothingTimeConstant;
|
|
350
|
+
this._analyser = node;
|
|
351
|
+
// If a source was set before the context was ready, connect it now.
|
|
352
|
+
if (this._source !== null) {
|
|
353
|
+
this._connectSource(this._source, audioContext);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
_connectSource(source, audioContext) {
|
|
357
|
+
if (!this._analyser)
|
|
358
|
+
return;
|
|
359
|
+
const tap = this._resolveToAudioNode(source, audioContext);
|
|
360
|
+
if (!tap) {
|
|
361
|
+
// AudioBus not ready yet — defer via its onceSetup
|
|
362
|
+
this._deferConnectionViaBus(source);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
this._tapSource = tap;
|
|
366
|
+
tap.connect(this._analyser);
|
|
367
|
+
}
|
|
368
|
+
_resolveToAudioNode(source, audioContext) {
|
|
369
|
+
if (source === null)
|
|
370
|
+
return null;
|
|
371
|
+
// MediaStream — detect by getTracks (duck-type, since AudioNode also doesn't exist in jsdom)
|
|
372
|
+
const asStream = source;
|
|
373
|
+
if (typeof asStream.getTracks === 'function') {
|
|
374
|
+
if (this._streamSource) {
|
|
375
|
+
this._streamSource.disconnect();
|
|
376
|
+
this._streamSource = null;
|
|
377
|
+
}
|
|
378
|
+
const msNode = audioContext.createMediaStreamSource(source);
|
|
379
|
+
this._streamSource = msNode;
|
|
380
|
+
return msNode;
|
|
381
|
+
}
|
|
382
|
+
// AudioBus — has _getOutputNode (checked first since bus nodes also have connect/disconnect)
|
|
383
|
+
const asBus = source;
|
|
384
|
+
if (typeof asBus._getOutputNode === 'function') {
|
|
385
|
+
return asBus._getOutputNode();
|
|
386
|
+
}
|
|
387
|
+
// Voice — tap its output node
|
|
388
|
+
const asVoice = source;
|
|
389
|
+
if ('output' in asVoice && asVoice.output) {
|
|
390
|
+
return asVoice.output;
|
|
391
|
+
}
|
|
392
|
+
// Raw AudioNode — duck-type: has connect & disconnect
|
|
393
|
+
const asNode = source;
|
|
394
|
+
if (typeof asNode.connect === 'function' && typeof asNode.disconnect === 'function') {
|
|
395
|
+
return source;
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
_deferConnectionViaBus(source) {
|
|
400
|
+
// AudioBus exposes onceSetup
|
|
401
|
+
const asBus = source;
|
|
402
|
+
if (typeof asBus.onceSetup === 'function') {
|
|
403
|
+
asBus.onceSetup(() => {
|
|
404
|
+
if (this._source === source && this._analyser && isAudioContextReady()) {
|
|
405
|
+
this._connectSource(source, getAudioContext());
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
// Otherwise retry once the audioContext is ready (same signal).
|
|
411
|
+
onAudioContextReady.once(() => {
|
|
412
|
+
if (this._source === source && this._analyser && isAudioContextReady()) {
|
|
413
|
+
this._connectSource(source, getAudioContext());
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
_disconnectTap() {
|
|
418
|
+
if (this._tapSource && this._analyser) {
|
|
419
|
+
try {
|
|
420
|
+
this._tapSource.disconnect(this._analyser);
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
// Ignore if already disconnected
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
this._tapSource = null;
|
|
427
|
+
// Clean up cached stream source
|
|
428
|
+
if (this._streamSource) {
|
|
429
|
+
this._streamSource.disconnect();
|
|
430
|
+
this._streamSource = null;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function buildLogRanges(bandCount, fMin, fMax, fftSize, sampleRate) {
|
|
435
|
+
const binCount = fftSize >> 1;
|
|
436
|
+
const nyquist = sampleRate / 2;
|
|
437
|
+
const logMin = Math.log(fMin);
|
|
438
|
+
const logMax = Math.log(fMax);
|
|
439
|
+
const ranges = [];
|
|
440
|
+
for (let b = 0; b < bandCount; b++) {
|
|
441
|
+
const lowHz = Math.exp(logMin + ((logMax - logMin) * b) / bandCount);
|
|
442
|
+
const highHz = Math.exp(logMin + ((logMax - logMin) * (b + 1)) / bandCount);
|
|
443
|
+
const startBin = Math.max(0, Math.min(binCount - 1, Math.floor((lowHz / nyquist) * binCount)));
|
|
444
|
+
const endBin = Math.max(startBin, Math.min(binCount - 1, Math.ceil((highHz / nyquist) * binCount) - 1));
|
|
445
|
+
ranges.push({ startBin, endBin });
|
|
446
|
+
}
|
|
447
|
+
return ranges;
|
|
448
|
+
}
|
|
449
|
+
function applyFilterbank(spectrum, bands, out) {
|
|
450
|
+
for (let b = 0; b < bands.length; b++) {
|
|
451
|
+
const { startBin, weights } = bands[b];
|
|
452
|
+
let sum = 0;
|
|
453
|
+
for (let i = 0; i < weights.length; i++) {
|
|
454
|
+
sum += spectrum[startBin + i] * weights[i];
|
|
455
|
+
}
|
|
456
|
+
out[b] = sum;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function applyLogRanges(spectrum, ranges, out) {
|
|
460
|
+
for (let b = 0; b < ranges.length; b++) {
|
|
461
|
+
const { startBin, endBin } = ranges[b];
|
|
462
|
+
let sum = 0;
|
|
463
|
+
const count = endBin - startBin + 1;
|
|
464
|
+
for (let i = startBin; i <= endBin; i++) {
|
|
465
|
+
sum += spectrum[i];
|
|
466
|
+
}
|
|
467
|
+
out[b] = sum / count;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export { AudioAnalyser };
|
|
472
|
+
//# sourceMappingURL=AudioAnalyser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioAnalyser.js","sources":["../../../src/AudioAnalyser.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAoCA;;;;;;;AAOG;MACU,aAAa,CAAA;IAChB,SAAS,GAAwB,IAAI;AAC5B,IAAA,QAAQ;IACjB,OAAO,GAAwB,IAAI;IACnC,UAAU,GAAqB,IAAI;IACnC,aAAa,GAAsC,IAAI;IACvD,mBAAmB,GAAyC,IAAI;AACvD,IAAA,oBAAoB,GAAG,CAAC,GAAiB,KAAU;AAClE,QAAA,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;AACrD,QAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;AAC1B,IAAA,CAAC;;AAGO,IAAA,aAAa;AACb,IAAA,cAAc;AACd,IAAA,aAAa;AACb,IAAA,cAAc;;;AAId,IAAA,SAAS,GAAG,IAAI,GAAG,EAAqB;AACxC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA0B;AAErD;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