@viji-dev/core 0.5.4 → 0.5.6
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/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-aU6UPupF.js → essentia-wasm.web-B2bIxnGE.js} +2 -2
- package/dist/{essentia-wasm.web-aU6UPupF.js.map → essentia-wasm.web-B2bIxnGE.js.map} +1 -1
- package/dist/{index-_PbbZgmh.js → index-Yg6_UX8C.js} +78 -27
- package/dist/{index-_PbbZgmh.js.map → index-Yg6_UX8C.js.map} +1 -1
- package/dist/index.d.ts +32 -12
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -218,6 +218,14 @@ export declare class AudioSystem {
|
|
|
218
218
|
private lastPhaseLogTime;
|
|
219
219
|
private onsetLogBuffer;
|
|
220
220
|
private debugMode;
|
|
221
|
+
/**
|
|
222
|
+
* One-way lifecycle flag flipped at the top of `resetAudioState()`.
|
|
223
|
+
* Gates re-entry into `ensureAudioContext()` and the public stream-mutation
|
|
224
|
+
* entry points so an in-flight async caller (e.g. a worker RPC firing
|
|
225
|
+
* mid-teardown) cannot resurrect a fresh `AudioContext` after destroy
|
|
226
|
+
* has already nulled the field. AudioSystem is single-use after reset.
|
|
227
|
+
*/
|
|
228
|
+
private destroyed;
|
|
221
229
|
private diagnosticLogger;
|
|
222
230
|
private onsetDetection;
|
|
223
231
|
private essentiaOnsetDetection;
|
|
@@ -419,8 +427,13 @@ export declare class AudioSystem {
|
|
|
419
427
|
/**
|
|
420
428
|
* Reset all audio state (called when destroying).
|
|
421
429
|
* Disconnects all channels, closes AudioContext, resets all modules.
|
|
430
|
+
*
|
|
431
|
+
* Returns a Promise that resolves once `AudioContext.close()` has fully
|
|
432
|
+
* transitioned the context to `closed`. Callers tearing the system down
|
|
433
|
+
* (e.g. `VijiCore.destroy()`) MUST await this; otherwise Blink keeps the
|
|
434
|
+
* context alive in `Pending activities` and leaks ~4 MB per cycle.
|
|
422
435
|
*/
|
|
423
|
-
resetAudioState(): void
|
|
436
|
+
resetAudioState(): Promise<void>;
|
|
424
437
|
/**
|
|
425
438
|
* Add an additional audio stream (lightweight analysis, no beat detection).
|
|
426
439
|
* @param streamIndex Global stream index (from VijiCore: AUDIO_ADDITIONAL_BASE + n or AUDIO_DEVICE_BASE + n)
|
|
@@ -442,9 +455,12 @@ export declare class AudioSystem {
|
|
|
442
455
|
getChannelCount(): number;
|
|
443
456
|
/**
|
|
444
457
|
* Record a tap for the specified instrument onset.
|
|
445
|
-
* `options.skipRecognition`
|
|
446
|
-
*
|
|
447
|
-
*
|
|
458
|
+
* `options.skipRecognition` opts the tap out of the recognition pipeline
|
|
459
|
+
* only (no IOI accumulation, no `tryRecognizePattern`, no `applyPattern`).
|
|
460
|
+
* Mode still flips `'auto' → 'tapping'` so the visual envelope and
|
|
461
|
+
* audio-event filter run; only the pattern-detection pipeline is bypassed.
|
|
462
|
+
* Used by host-side relay of forwarded tap messages where another core
|
|
463
|
+
* owns the authoritative recognition.
|
|
448
464
|
*/
|
|
449
465
|
tapOnset(instrument: InstrumentType, options?: {
|
|
450
466
|
skipRecognition?: boolean;
|
|
@@ -2251,7 +2267,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
|
|
|
2251
2267
|
/** Returned by `on*` listener registration calls; invoke to unsubscribe. */
|
|
2252
2268
|
export declare type Unsubscribe = () => void;
|
|
2253
2269
|
|
|
2254
|
-
export declare const VERSION = "0.5.
|
|
2270
|
+
export declare const VERSION = "0.5.6";
|
|
2255
2271
|
|
|
2256
2272
|
/**
|
|
2257
2273
|
* Real-time video API: drawable frame, dimensions, and the source-side
|
|
@@ -3023,13 +3039,17 @@ export declare class VijiCore {
|
|
|
3023
3039
|
* First tap switches the instrument from auto to tapping mode.
|
|
3024
3040
|
* If a repeating pattern is recognized, it continues after tapping stops.
|
|
3025
3041
|
*
|
|
3026
|
-
* `options.skipRecognition: true`
|
|
3027
|
-
*
|
|
3028
|
-
* no
|
|
3029
|
-
*
|
|
3030
|
-
*
|
|
3031
|
-
*
|
|
3032
|
-
*
|
|
3042
|
+
* `options.skipRecognition: true` opts the tap out of the **recognition
|
|
3043
|
+
* pipeline only** — no `tapIOIs` accumulation, no `tryRecognizePattern`,
|
|
3044
|
+
* no `applyPattern`, no `handlePatternTap`. Mode still flips
|
|
3045
|
+
* `'auto' → 'tapping'` on the first tap of a session (and back to
|
|
3046
|
+
* `'auto'` on the 5s timeout). The mode flip is load-bearing for
|
|
3047
|
+
* `processFrame`'s drain of `pendingTapEvents`, the audio-event filter
|
|
3048
|
+
* that prevents music+tap doubling, and `onModeChange` consumers. Use
|
|
3049
|
+
* `skipRecognition` when relaying tap messages from another instance
|
|
3050
|
+
* that owns the authoritative recognition (e.g. host receiving
|
|
3051
|
+
* controller taps over WebRTC); the receiving core's pattern is then
|
|
3052
|
+
* driven only by `importSessionState` from the authoritative sender.
|
|
3033
3053
|
*
|
|
3034
3054
|
* The `MIN_TAP_INTERVAL_MS` debounce still applies regardless of the
|
|
3035
3055
|
* `skipRecognition` flag.
|
package/dist/index.js
CHANGED