wavegram 0.1.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +198 -0
  3. package/dist/assets/spectrogram.worker-Burn7NUr.js +1 -0
  4. package/dist/audio/decodeAudio.d.ts +2 -0
  5. package/dist/audio/decodeAudio.d.ts.map +1 -0
  6. package/dist/audio/loadAudio.d.ts +2 -0
  7. package/dist/audio/loadAudio.d.ts.map +1 -0
  8. package/dist/audio/playback.d.ts +2 -0
  9. package/dist/audio/playback.d.ts.map +1 -0
  10. package/dist/audio/spectrogram.d.ts +8 -0
  11. package/dist/audio/spectrogram.d.ts.map +1 -0
  12. package/dist/audio/waveform.d.ts +4 -0
  13. package/dist/audio/waveform.d.ts.map +1 -0
  14. package/dist/component/Wavegram.d.ts +108 -0
  15. package/dist/component/Wavegram.d.ts.map +1 -0
  16. package/dist/index.d.ts +6 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.es.js +1024 -0
  19. package/dist/index.umd.js +191 -0
  20. package/dist/render/canvas.d.ts +2 -0
  21. package/dist/render/canvas.d.ts.map +1 -0
  22. package/dist/render/colorMap.d.ts +4 -0
  23. package/dist/render/colorMap.d.ts.map +1 -0
  24. package/dist/render/drawCursor.d.ts +2 -0
  25. package/dist/render/drawCursor.d.ts.map +1 -0
  26. package/dist/render/drawSpectrogram.d.ts +8 -0
  27. package/dist/render/drawSpectrogram.d.ts.map +1 -0
  28. package/dist/render/drawWaveform.d.ts +13 -0
  29. package/dist/render/drawWaveform.d.ts.map +1 -0
  30. package/dist/types.d.ts +50 -0
  31. package/dist/types.d.ts.map +1 -0
  32. package/dist/utils/clamp.d.ts +2 -0
  33. package/dist/utils/clamp.d.ts.map +1 -0
  34. package/dist/utils/formatTime.d.ts +2 -0
  35. package/dist/utils/formatTime.d.ts.map +1 -0
  36. package/dist/utils/resample.d.ts +2 -0
  37. package/dist/utils/resample.d.ts.map +1 -0
  38. package/dist/worker/spectrogram.worker.d.ts +2 -0
  39. package/dist/worker/spectrogram.worker.d.ts.map +1 -0
  40. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
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,198 @@
1
+ # wavegram
2
+
3
+ Lightweight Web Component for previewing audio with a synchronized waveform, spectrogram, and playback cursor. It is intended for research demos, paper companion pages, audio dataset previews, and source-separation result comparisons.
4
+
5
+ It is not an editor. It does not implement recording, effects, multitrack editing, annotation editing, ASR, or server-side processing.
6
+
7
+ ## Design Focus
8
+
9
+ Wavegram is closest in spirit to lightweight waveform players such as wavesurfer.js, but its primary view is not just a waveform. It always treats waveform and spectrogram as two synchronized views over the same audio timeline.
10
+
11
+ The core feature set is deliberately narrow:
12
+
13
+ - Simultaneous waveform and spectrogram display.
14
+ - One playback cursor rendered at the same time position in both views.
15
+ - Click-to-seek from either waveform or spectrogram. By default, clicking a stopped player starts playback from that position, and clicking a playing player pauses after seeking.
16
+ - Scientific, low-decoration presentation suitable for papers, demos, and dataset browsers.
17
+ - No DAW-style editing, multitrack arrangement, effects, recording, or annotation workflow.
18
+
19
+ ## Install
20
+
21
+ ```sh
22
+ npm install wavegram
23
+ ```
24
+
25
+ ```ts
26
+ import "wavegram";
27
+ ```
28
+
29
+ ## Minimal Usage
30
+
31
+ ```html
32
+ <wavegram-player
33
+ src="https://raw.githubusercontent.com/pdx-cs-sound/wavs/main/voice.wav"
34
+ ></wavegram-player>
35
+ ```
36
+
37
+ The package is named `wavegram`. The custom element tag is `wavegram-player` because browser custom element names must contain a hyphen.
38
+
39
+ The `src` value may be a relative URL such as `audio/example.wav` or an absolute URI such as the example above.
40
+ Remote audio must be served with CORS headers so the component can fetch and decode it for waveform and spectrogram analysis.
41
+
42
+ ```ts
43
+ const player = document.createElement("wavegram-player");
44
+ player.src = "https://raw.githubusercontent.com/pdx-cs-sound/wavs/main/voice.wav";
45
+ document.body.appendChild(player);
46
+ ```
47
+
48
+ ## Attributes
49
+
50
+ | Attribute | Property | Default | Description |
51
+ | --- | --- | --- | --- |
52
+ | `src` | `src` | `""` | Audio URL. Uses browser-supported `decodeAudioData()` formats. |
53
+ | `height` | `height` | `200` | Total visual height. Used to auto-allocate pane heights when individual heights are not set. |
54
+ | `waveform-height` | `waveformHeight` | `80` | Waveform canvas height in CSS pixels. |
55
+ | `spectrogram-height` | `spectrogramHeight` | `120` | Spectrogram canvas height in CSS pixels. |
56
+ | `show-waveform` | `showWaveform` | `true` | Show waveform pane. |
57
+ | `show-spectrogram` | `showSpectrogram` | `true` | Show spectrogram pane. |
58
+ | `show-controls` | `showControls` | `false` | Show the play/pause button. |
59
+ | `show-time` | `showTime` | `false` | Show current time and duration. |
60
+ | `waveform-style` | `waveformStyle` | `waveform` | `waveform`, `bars`, `lines`, `blocks`, or `dots`. `line` is accepted as a legacy alias. |
61
+ | `waveform-bar-width` | `waveformBarWidth` | style-dependent | Width of bars, blocks, or dots in CSS pixels. |
62
+ | `waveform-bar-spacing` | `waveformBarSpacing` | style-dependent | Spacing between bars, blocks, or dots in CSS pixels. |
63
+ | `autoplay` | `autoplay` | `false` | Start playback after loading. Browser autoplay policies still apply. |
64
+ | `fft-size` | `fftSize` | `1024` | Radix-2 FFT size. Non-power-of-two values are errors. |
65
+ | `hop-size` | `hopSize` | `256` | STFT hop size in samples. |
66
+ | `window-type` | `windowType` | `hann` | `hann`, `hamming`, or `rectangular`. |
67
+ | `min-db` | `minDb` | `-80` | Lower display bound. |
68
+ | `max-db` | `maxDb` | `0` | Upper display bound. |
69
+ | `color-map` | `colorMap` | `audition` | `audition`, `gray`, `magma`, `viridis`, or `inferno`. |
70
+ | `channel` | `channel` | `mix` | `mix` or zero-based channel index. |
71
+
72
+ ## Events
73
+
74
+ The component dispatches `CustomEvent`s named `loadstart`, `loaded`, `play`, `pause`, `seek`, `timeupdate`, `profile`, `playprofile`, and `error`.
75
+
76
+ Normal event detail:
77
+
78
+ ```ts
79
+ {
80
+ currentTime: number;
81
+ duration: number;
82
+ }
83
+ ```
84
+
85
+ Error event detail:
86
+
87
+ ```ts
88
+ {
89
+ message: string;
90
+ cause?: unknown;
91
+ }
92
+ ```
93
+
94
+ `profile` reports load and analysis timing in milliseconds. It is emitted once when the player first becomes usable and again when spectrogram analysis finishes:
95
+
96
+ ```ts
97
+ {
98
+ fetchMs: number;
99
+ audioReadyMs: number;
100
+ decodeMs: number;
101
+ waveformMs: number;
102
+ spectrogramMs?: number;
103
+ firstUsableMs: number;
104
+ totalMs?: number;
105
+ }
106
+ ```
107
+
108
+ `playprofile` reports playback startup latency:
109
+
110
+ ```ts
111
+ {
112
+ playToPlayingMs: number;
113
+ }
114
+ ```
115
+
116
+ ## Spectrogram Settings
117
+
118
+ Spectrograms are computed with STFT:
119
+
120
+ ```text
121
+ S[k, t] = 20 log10(|FFT(x_t)[k]| + 1e-10)
122
+ ```
123
+
124
+ The internal `values` layout is time-major:
125
+
126
+ ```ts
127
+ values[t * freqBins + k]
128
+ ```
129
+
130
+ The initial implementation uses a pure TypeScript radix-2 FFT and runs spectrogram analysis in a Web Worker when Workers are available. If Workers are unavailable, the component can fall back to waveform-only or main-thread analysis depending on the environment.
131
+
132
+ ## Browser Support
133
+
134
+ Audio decoding follows `AudioContext.decodeAudioData()` support in the user's browser. WAV, MP3, and Ogg Vorbis are common targets. FLAC support is browser-dependent.
135
+
136
+ Playback uses `HTMLAudioElement`; waveform and spectrogram analysis use `AudioBuffer`.
137
+
138
+ ## Backward Compatibility
139
+
140
+ The recommended element name is `<wavegram-player>`.
141
+ The older `<audio-preview-spectrogram>` tag is still registered as a compatibility alias.
142
+
143
+ ## Demo Audio
144
+
145
+ The examples use WAV files from [`pdx-cs-sound/wavs`](https://github.com/pdx-cs-sound/wavs), a sample collection for Portland State University's Computers, Sound and Music course. The repository states that the files are Creative Commons CC0 unless otherwise indicated.
146
+
147
+ ## Styling
148
+
149
+ The component uses Shadow DOM and supports CSS custom properties:
150
+
151
+ ```css
152
+ wavegram-player {
153
+ --ap-bg: #ffffff;
154
+ --ap-fg: #222222;
155
+ --ap-waveform-bg: #020604;
156
+ --ap-waveform: rgba(0, 214, 163, 0.34);
157
+ --ap-waveform-played: #00f0b5;
158
+ --ap-waveform-center: rgba(0, 92, 58, 0.7);
159
+ --ap-waveform-progress: #00f0b5;
160
+ --ap-cursor: #00d7ff;
161
+ --ap-cursor-shadow: rgba(0, 0, 0, 0.45);
162
+ --ap-spectrogram-tick: rgba(255, 255, 255, 0.42);
163
+ --ap-spectrogram-unplayed-opacity: 0.48;
164
+ --ap-border: #dddddd;
165
+ }
166
+ ```
167
+
168
+ ## Known Limitations
169
+
170
+ Long audio files are supported conservatively in the initial version. Large decoded buffers can still consume significant memory, and precomputed waveform or spectrogram JSON is reserved for a future extension.
171
+
172
+ The component fetches each audio source once, then creates a Blob URL for playback and decodes the same `ArrayBuffer` for analysis. This avoids a second network request for `HTMLAudioElement` playback.
173
+
174
+ ## Development
175
+
176
+ ```sh
177
+ npm install
178
+ npm run build
179
+ npm test
180
+ npm run test:e2e
181
+ ```
182
+
183
+ ## Examples
184
+
185
+ Run `npm run dev` and open:
186
+
187
+ - `examples/basic.html`
188
+ - `examples/multiple.html`
189
+ - `examples/large-file.html`
190
+ - `examples/profile.html`
191
+ - `examples/multichannel.html`
192
+ - `examples/waveform-only.html`
193
+ - `examples/spectrogram-only.html`
194
+ - `examples/styles.html`
195
+
196
+ ## License
197
+
198
+ MIT
@@ -0,0 +1 @@
1
+ (function(){"use strict";function g(t,o,n){return Math.min(n,Math.max(o,t))}const b=1e-10;function M(t){return Number.isInteger(t)&&t>0&&(t&t-1)===0}function x(t,o){const n=new Float32Array(t);if(t===1)return n[0]=1,n;for(let e=0;e<t;e+=1)o==="hann"?n[e]=.5-.5*Math.cos(2*Math.PI*e/(t-1)):o==="hamming"?n[e]=.54-.46*Math.cos(2*Math.PI*e/(t-1)):n[e]=1;return n}function S(t){let o=0;for(const n of t)o+=n;return o/t.length}function D(t){return 20*Math.log10(Math.abs(t)+b)}function I(t,o){const n=t.length;if(!M(n)||o.length!==n)throw new Error("FFT input length must be a radix-2 size.");for(let e=1,a=0;e<n;e+=1){let f=n>>1;for(;a&f;f>>=1)a^=f;if(a^=f,e<a){const h=t[e];t[e]=t[a],t[a]=h;const r=o[e];o[e]=o[a],o[a]=r}}for(let e=2;e<=n;e<<=1){const a=-2*Math.PI/e,f=Math.cos(a),h=Math.sin(a);for(let r=0;r<n;r+=e){let c=1,l=0;for(let s=0;s<e/2;s+=1){const d=t[r+s],p=o[r+s],m=t[r+s+e/2]*c-o[r+s+e/2]*l,u=t[r+s+e/2]*l+o[r+s+e/2]*c;t[r+s]=d+m,o[r+s]=p+u,t[r+s+e/2]=d-m,o[r+s+e/2]=p-u;const w=c*f-l*h;l=c*h+l*f,c=w}}}}function R(t,o,n){const{fftSize:e,hopSize:a,windowType:f,minDb:h,maxDb:r}=n;if(!M(e))throw new Error(`fftSize must be a power of two. Received ${e}.`);if(!Number.isInteger(a)||a<=0)throw new Error(`hopSize must be a positive integer. Received ${a}.`);if(r<=h)throw new Error("maxDb must be greater than minDb.");const c=e/2+1,l=Math.max(1,Math.floor(Math.max(0,t.length-e)/a)+1),s=new Float32Array(l*c),d=x(e,f),p=Math.max(b,e*S(d)/2),m=new Float32Array(e),u=new Float32Array(e);for(let w=0;w<l;w+=1){const y=w*a;m.fill(0),u.fill(0);for(let i=0;i<e;i+=1)m[i]=(t[y+i]??0)*d[i];I(m,u);for(let i=0;i<c;i+=1){const F=Math.hypot(m[i],u[i])/p;s[w*c+i]=g(D(F),h,r)}}return{values:s,freqBins:c,timeFrames:l,sampleRate:o,fftSize:e,hopSize:a,minDb:h,maxDb:r}}self.addEventListener("message",t=>{try{const o=R(t.data.samples,t.data.sampleRate,{fftSize:t.data.fftSize,hopSize:t.data.hopSize,windowType:t.data.windowType,minDb:t.data.minDb,maxDb:t.data.maxDb});self.postMessage(o,[o.values.buffer])}catch(o){self.postMessage({error:{message:o instanceof Error?o.message:"Failed to compute spectrogram."}})}})})();
@@ -0,0 +1,2 @@
1
+ export declare function decodeAudioData(arrayBuffer: ArrayBuffer): Promise<AudioBuffer>;
2
+ //# sourceMappingURL=decodeAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeAudio.d.ts","sourceRoot":"","sources":["../../src/audio/decodeAudio.ts"],"names":[],"mappings":"AAOA,wBAAsB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAGpF"}
@@ -0,0 +1,2 @@
1
+ export declare function loadAudio(src: string): Promise<ArrayBuffer>;
2
+ //# sourceMappingURL=loadAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAudio.d.ts","sourceRoot":"","sources":["../../src/audio/loadAudio.ts"],"names":[],"mappings":"AAAA,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAMjE"}
@@ -0,0 +1,2 @@
1
+ export declare function createAudioElement(src: string, autoplay: boolean): HTMLAudioElement;
2
+ //# sourceMappingURL=playback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/audio/playback.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,gBAAgB,CAMnF"}
@@ -0,0 +1,8 @@
1
+ import { SpectrogramData, SpectrogramOptions, WindowType } from '../types';
2
+ export declare function isPowerOfTwo(value: number): boolean;
3
+ export declare function createWindow(size: number, type: WindowType): Float32Array;
4
+ export declare function coherentGain(window: Float32Array): number;
5
+ export declare function amplitudeToDb(amplitude: number): number;
6
+ export declare function fftRadix2(real: Float32Array, imag: Float32Array): void;
7
+ export declare function computeSpectrogram(samples: Float32Array, sampleRate: number, options: SpectrogramOptions): SpectrogramData;
8
+ //# sourceMappingURL=spectrogram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spectrogram.d.ts","sourceRoot":"","sources":["../../src/audio/spectrogram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKhF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,CAiBzE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAMzD;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAgDtE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAsCjB"}
@@ -0,0 +1,4 @@
1
+ import { WaveformPeaks } from '../types';
2
+ export declare function computeWaveformPeaks(samples: Float32Array, width: number): WaveformPeaks;
3
+ export declare function computeWaveformPeaksFromBuffer(buffer: AudioBuffer, width: number, channel: number | "mix"): WaveformPeaks;
4
+ //# sourceMappingURL=waveform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waveform.d.ts","sourceRoot":"","sources":["../../src/audio/waveform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAuBxF;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,KAAK,GACtB,aAAa,CAEf"}
@@ -0,0 +1,108 @@
1
+ import { ChannelSelection, ColorMapName, WaveformStyle, WindowType } from '../types';
2
+ export declare class Wavegram extends HTMLElement {
3
+ static observedAttributes: string[];
4
+ private audio?;
5
+ private audioBuffer?;
6
+ private waveformPeaks?;
7
+ private spectrogram?;
8
+ private worker?;
9
+ private resizeObserver?;
10
+ private animationFrame;
11
+ private loadingToken;
12
+ private blobUrl?;
13
+ private playRequestedAt?;
14
+ private readonly root;
15
+ private readonly button;
16
+ private readonly toolbar;
17
+ private readonly timeEl;
18
+ private readonly currentEl;
19
+ private readonly durationEl;
20
+ private readonly statusEl;
21
+ private readonly errorEl;
22
+ private readonly waveformPane;
23
+ private readonly spectrogramPane;
24
+ private readonly waveformCanvas;
25
+ private readonly spectrogramCanvas;
26
+ private readonly spectrogramOverlay;
27
+ private readonly waveformCursor;
28
+ private readonly spectrogramCursor;
29
+ constructor();
30
+ get src(): string;
31
+ set src(value: string);
32
+ get height(): number;
33
+ set height(value: number);
34
+ get waveformHeight(): number;
35
+ set waveformHeight(value: number);
36
+ get spectrogramHeight(): number;
37
+ set spectrogramHeight(value: number);
38
+ get showWaveform(): boolean;
39
+ set showWaveform(value: boolean);
40
+ get showSpectrogram(): boolean;
41
+ set showSpectrogram(value: boolean);
42
+ get showControls(): boolean;
43
+ set showControls(value: boolean);
44
+ get showTime(): boolean;
45
+ set showTime(value: boolean);
46
+ get waveformStyle(): WaveformStyle;
47
+ set waveformStyle(value: WaveformStyle);
48
+ get waveformBarWidth(): number | undefined;
49
+ set waveformBarWidth(value: number);
50
+ get waveformBarSpacing(): number | undefined;
51
+ set waveformBarSpacing(value: number);
52
+ get autoplay(): boolean;
53
+ set autoplay(value: boolean);
54
+ get fftSize(): number;
55
+ set fftSize(value: number);
56
+ get hopSize(): number;
57
+ set hopSize(value: number);
58
+ get windowType(): WindowType;
59
+ set windowType(value: WindowType);
60
+ get minDb(): number;
61
+ set minDb(value: number);
62
+ get maxDb(): number;
63
+ set maxDb(value: number);
64
+ get colorMap(): ColorMapName;
65
+ set colorMap(value: ColorMapName);
66
+ get channel(): ChannelSelection;
67
+ set channel(value: ChannelSelection);
68
+ connectedCallback(): void;
69
+ disconnectedCallback(): void;
70
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
71
+ private load;
72
+ private recomputeAnalysis;
73
+ private computeSpectrogramForCurrentBuffer;
74
+ private computeSpectrogramInWorker;
75
+ private bindAudio;
76
+ private layoutAndRender;
77
+ private drawCursors;
78
+ private clearCursor;
79
+ private drawSpectrogramOverlay;
80
+ private readonly handlePlayButton;
81
+ private readonly handleSeekClick;
82
+ private readonly handleKeydown;
83
+ private readonly handleTimeUpdate;
84
+ private readonly handleAudioPlay;
85
+ private readonly handleAudioPlaying;
86
+ private readonly handleAudioPause;
87
+ private startAnimation;
88
+ private stopAnimation;
89
+ private updateTimeLabels;
90
+ private get duration();
91
+ private get playbackProgress();
92
+ private dispatchTypedEvent;
93
+ private handleError;
94
+ private clearError;
95
+ private setStatus;
96
+ private getCanvasWidth;
97
+ private getPaneHeights;
98
+ private getNumberAttribute;
99
+ private getOptionalNumberAttribute;
100
+ private getBooleanAttribute;
101
+ private setBooleanAttribute;
102
+ private cssVar;
103
+ private cssNumberVar;
104
+ private requireElement;
105
+ private waitForAudioReady;
106
+ private revokeBlobUrl;
107
+ }
108
+ //# sourceMappingURL=Wavegram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wavegram.d.ts","sourceRoot":"","sources":["../../src/component/Wavegram.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EAQZ,aAAa,EACb,UAAU,EACX,MAAM,UAAU,CAAC;AAqMlB,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,kBAAkB,WAoBvB;IAEF,OAAO,CAAC,KAAK,CAAC,CAAmB;IACjC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,aAAa,CAAC,CAAgB;IACtC,OAAO,CAAC,WAAW,CAAC,CAAkB;IACtC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,QAAQ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B;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAI5B;IAEF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAG/B;IAEF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAK9B;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CASjC;IAEF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAO/B;IAEF,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB,CAGtB;IAEF,OAAO,KAAK,QAAQ,GAEnB;IAED,OAAO,KAAK,gBAAgB,GAI3B;IAED,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,cAAc;IAwCtB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,0BAA0B;IAMlC,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,aAAa;CAMtB"}
@@ -0,0 +1,6 @@
1
+ import { Wavegram } from './component/Wavegram';
2
+ declare class AudioPreviewSpectrogram extends Wavegram {
3
+ }
4
+ export { AudioPreviewSpectrogram, Wavegram };
5
+ export type { ChannelSelection, ColorMapName, LoadProfileDetail, PlayerErrorDetail, PlayerEventDetail, PlaybackProfileDetail, SpectrogramData, SpectrogramOptions, WaveformPeaks, WaveformStyle, WindowType, } from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,cAAM,uBAAwB,SAAQ,QAAQ;CAAG;AASjD,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,CAAC;AAC7C,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC"}