@mediapipe/tasks-audio 0.10.4 → 0.10.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/audio.d.ts +21 -1
- package/audio_bundle.cjs +1 -1
- package/audio_bundle.cjs.map +1 -1
- package/audio_bundle.mjs +1 -1
- package/audio_bundle.mjs.map +1 -1
- package/package.json +3 -2
- package/wasm/audio_wasm_internal.js +2 -2
- package/wasm/audio_wasm_internal.wasm +0 -0
- package/wasm/audio_wasm_nosimd_internal.js +2 -2
- package/wasm/audio_wasm_nosimd_internal.wasm +0 -0
package/audio.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
3
3
|
/**
|
|
4
4
|
* Initializes the Wasm runtime and creates a new audio classifier from the
|
|
5
5
|
* provided options.
|
|
6
|
+
* @export
|
|
6
7
|
* @param wasmFileset A configuration object that provides the location of the
|
|
7
8
|
* Wasm binary and its loader.
|
|
8
9
|
* @param audioClassifierOptions The options for the audio classifier. Note
|
|
@@ -13,6 +14,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
13
14
|
/**
|
|
14
15
|
* Initializes the Wasm runtime and creates a new audio classifier based on
|
|
15
16
|
* the provided model asset buffer.
|
|
17
|
+
* @export
|
|
16
18
|
* @param wasmFileset A configuration object that provides the location of the
|
|
17
19
|
* Wasm binary and its loader.
|
|
18
20
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -21,6 +23,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
21
23
|
/**
|
|
22
24
|
* Initializes the Wasm runtime and creates a new audio classifier based on
|
|
23
25
|
* the path to the model asset.
|
|
26
|
+
* @export
|
|
24
27
|
* @param wasmFileset A configuration object that provides the location of the
|
|
25
28
|
* Wasm binary and its loader.
|
|
26
29
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -34,6 +37,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
34
37
|
* You can reset an option back to its default value by explicitly setting it
|
|
35
38
|
* to `undefined`.
|
|
36
39
|
*
|
|
40
|
+
* @export
|
|
37
41
|
* @param options The options for the audio classifier.
|
|
38
42
|
*/
|
|
39
43
|
setOptions(options: AudioClassifierOptions): Promise<void>;
|
|
@@ -41,6 +45,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
41
45
|
* Performs audio classification on the provided audio clip and waits
|
|
42
46
|
* synchronously for the response.
|
|
43
47
|
*
|
|
48
|
+
* @export
|
|
44
49
|
* @param audioData An array of raw audio capture data, like from a call to
|
|
45
50
|
* `getChannelData()` on an AudioBuffer.
|
|
46
51
|
* @param sampleRate The sample rate in Hz of the provided audio data. If not
|
|
@@ -76,6 +81,7 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
76
81
|
/**
|
|
77
82
|
* Initializes the Wasm runtime and creates a new audio embedder from the
|
|
78
83
|
* provided options.
|
|
84
|
+
* @export
|
|
79
85
|
* @param wasmFileset A configuration object that provides the location of the
|
|
80
86
|
* Wasm binary and its loader.
|
|
81
87
|
* @param audioEmbedderOptions The options for the audio embedder. Note that
|
|
@@ -86,6 +92,7 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
86
92
|
/**
|
|
87
93
|
* Initializes the Wasm runtime and creates a new audio embedder based on the
|
|
88
94
|
* provided model asset buffer.
|
|
95
|
+
* @export
|
|
89
96
|
* @param wasmFileset A configuration object that provides the location of the
|
|
90
97
|
* Wasm binary and its loader.
|
|
91
98
|
* @param modelAssetBuffer A binary representation of the TFLite model.
|
|
@@ -94,6 +101,7 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
94
101
|
/**
|
|
95
102
|
* Initializes the Wasm runtime and creates a new audio embedder based on the
|
|
96
103
|
* path to the model asset.
|
|
104
|
+
* @export
|
|
97
105
|
* @param wasmFileset A configuration object that provides the location of the
|
|
98
106
|
* Wasm binary and its loader.
|
|
99
107
|
* @param modelAssetPath The path to the TFLite model.
|
|
@@ -107,6 +115,7 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
107
115
|
* You can reset an option back to its default value by explicitly setting it
|
|
108
116
|
* to `undefined`.
|
|
109
117
|
*
|
|
118
|
+
* @export
|
|
110
119
|
* @param options The options for the audio embedder.
|
|
111
120
|
*/
|
|
112
121
|
setOptions(options: AudioEmbedderOptions): Promise<void>;
|
|
@@ -114,6 +123,7 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
114
123
|
* Performs embeding extraction on the provided audio clip and waits
|
|
115
124
|
* synchronously for the response.
|
|
116
125
|
*
|
|
126
|
+
* @export
|
|
117
127
|
* @param audioData An array of raw audio capture data, like from a call to
|
|
118
128
|
* `getChannelData()` on an AudioBuffer.
|
|
119
129
|
* @param sampleRate The sample rate in Hz of the provided audio data. If not
|
|
@@ -152,6 +162,7 @@ declare abstract class AudioTaskRunner<T> extends TaskRunner {
|
|
|
152
162
|
* Sets the sample rate for API calls that omit an explicit sample rate.
|
|
153
163
|
* `48000` is used as a default if this method is not called.
|
|
154
164
|
*
|
|
165
|
+
* @export
|
|
155
166
|
* @param sampleRate A sample rate (e.g. `44100`).
|
|
156
167
|
*/
|
|
157
168
|
setDefaultSampleRate(sampleRate: number): void;
|
|
@@ -380,12 +391,14 @@ export declare class FilesetResolver {
|
|
|
380
391
|
* you can use `isSimdSupported()` to decide whether to load the SIMD-based
|
|
381
392
|
* assets.
|
|
382
393
|
*
|
|
394
|
+
* @export
|
|
383
395
|
* @return Whether SIMD support was detected in the current environment.
|
|
384
396
|
*/
|
|
385
397
|
static isSimdSupported(): Promise<boolean>;
|
|
386
398
|
/**
|
|
387
399
|
* Creates a fileset for the MediaPipe Audio tasks.
|
|
388
400
|
*
|
|
401
|
+
* @export
|
|
389
402
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
390
403
|
* files should be loaded from. If not specified, the Wasm files are
|
|
391
404
|
* loaded from the host's root directory.
|
|
@@ -396,6 +409,7 @@ export declare class FilesetResolver {
|
|
|
396
409
|
/**
|
|
397
410
|
* Creates a fileset for the MediaPipe Text tasks.
|
|
398
411
|
*
|
|
412
|
+
* @export
|
|
399
413
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
400
414
|
* files should be loaded from. If not specified, the Wasm files are
|
|
401
415
|
* loaded from the host's root directory.
|
|
@@ -406,6 +420,7 @@ export declare class FilesetResolver {
|
|
|
406
420
|
/**
|
|
407
421
|
* Creates a fileset for the MediaPipe Vision tasks.
|
|
408
422
|
*
|
|
423
|
+
* @export
|
|
409
424
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
410
425
|
* files should be loaded from. If not specified, the Wasm files are
|
|
411
426
|
* loaded from the host's root directory.
|
|
@@ -420,7 +435,10 @@ declare abstract class TaskRunner {
|
|
|
420
435
|
protected constructor();
|
|
421
436
|
/** Configures the task with custom options. */
|
|
422
437
|
abstract setOptions(options: TaskRunnerOptions): Promise<void>;
|
|
423
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* Closes and cleans up the resources held by this task.
|
|
440
|
+
* @export
|
|
441
|
+
*/
|
|
424
442
|
close(): void;
|
|
425
443
|
}
|
|
426
444
|
|
|
@@ -453,6 +471,8 @@ declare interface WasmFileset {
|
|
|
453
471
|
wasmBinaryPath: string;
|
|
454
472
|
/** The optional path to the asset loader script. */
|
|
455
473
|
assetLoaderPath?: string;
|
|
474
|
+
/** The optional path to the assets binary. */
|
|
475
|
+
assetBinaryPath?: string;
|
|
456
476
|
}
|
|
457
477
|
|
|
458
478
|
export { }
|