@picovoice/cobra-web-factory
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -7,2 +7,3 @@ import { CobraEngine } from '@picovoice/cobra-web-core'; | ||
private _wasmMemory; | ||
private _pvFree; | ||
private _memoryBuffer; | ||
@@ -9,0 +10,0 @@ private _memoryBufferView; |
{ | ||
"name": "@picovoice/cobra-web-factory", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Cobra library for web browsers (via WebAssembly)", | ||
@@ -37,3 +37,3 @@ "author": "Picovoice Inc", | ||
"@babel/runtime": "^7.12.13", | ||
"@picovoice/web-utils": "^1.0.0", | ||
"@picovoice/web-utils": "^1.0.1", | ||
"@rollup/plugin-babel": "^5.2.3", | ||
@@ -40,0 +40,0 @@ "@rollup/plugin-commonjs": "^17.1.0", |
@@ -19,4 +19,5 @@ /* | ||
import { | ||
aligned_alloc_type, | ||
import { | ||
aligned_alloc_type, | ||
pv_free_type, | ||
buildWasm, | ||
@@ -53,2 +54,3 @@ arrayBufferToStringAtIndex, | ||
memory: WebAssembly.Memory; | ||
pvFree: pv_free_type; | ||
objectAddress: number; | ||
@@ -71,2 +73,3 @@ pvCobraDelete: pv_cobra_delete_type; | ||
private _wasmMemory: WebAssembly.Memory; | ||
private _pvFree: pv_free_type | ||
private _memoryBuffer: Int16Array; | ||
@@ -96,2 +99,4 @@ private _memoryBufferView: DataView; | ||
this._wasmMemory = handleWasm.memory; | ||
this._pvFree = handleWasm.pvFree; | ||
this._objectAddress = handleWasm.objectAddress; | ||
@@ -111,2 +116,4 @@ this._inputBufferAddress = handleWasm.inputBufferAddress; | ||
await this._pvCobraDelete(this._objectAddress); | ||
await this._pvFree(this._voiceProbabilityAddress); | ||
await this._pvFree(this._inputBufferAddress); | ||
} | ||
@@ -217,2 +224,3 @@ | ||
const aligned_alloc = exports.aligned_alloc as aligned_alloc_type; | ||
const pv_free = exports.pv_free as pv_free_type; | ||
const pv_cobra_version = exports.pv_cobra_version as pv_cobra_version_type; | ||
@@ -257,2 +265,3 @@ const pv_cobra_frame_length = exports.pv_cobra_frame_length as pv_cobra_frame_length_type; | ||
const status = await pv_cobra_init(accessKeyAddress, objectAddressAddress); | ||
await pv_free(accessKeyAddress); | ||
if (status !== PV_STATUS_SUCCESS) { | ||
@@ -268,2 +277,3 @@ throw new Error( | ||
const objectAddress = memoryBufferView.getInt32(objectAddressAddress, true); | ||
await pv_free(objectAddressAddress); | ||
@@ -290,2 +300,3 @@ const sampleRate = await pv_sample_rate(); | ||
memory: memory, | ||
pvFree: pv_free, | ||
objectAddress: objectAddress, | ||
@@ -292,0 +303,0 @@ pvCobraDelete: pv_cobra_delete, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1730973
12091
5