@picovoice/cheetah-web
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,3 +0,3 @@ | ||
import { PvModel } from "@picovoice/web-utils"; | ||
import { CheetahError } from "./cheetah_errors"; | ||
import { PvModel } from '@picovoice/web-utils'; | ||
import { CheetahError } from './cheetah_errors'; | ||
export declare enum PvStatus { | ||
@@ -4,0 +4,0 @@ SUCCESS = 10000, |
@@ -6,3 +6,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"keywords": [ | ||
@@ -39,3 +39,3 @@ "cheetah", | ||
"dependencies": { | ||
"@picovoice/web-utils": "=1.3.1" | ||
"@picovoice/web-utils": "=1.4.3" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -16,3 +16,3 @@ # Cheetah Binding for Web | ||
- Chrome, Safari, Firefox, and Edge | ||
- Raspberry Pi (4, 3) and NVIDIA Jetson Nano | ||
- Raspberry Pi (3, 4, 5) | ||
@@ -195,4 +195,11 @@ ## Compatibility | ||
### Language Model | ||
Default models for supported languages can be found in [lib/common](../../lib/common). | ||
Create custom language models using the [Picovoice Console](https://console.picovoice.ai/). Here you can train | ||
language models with custom vocabulary and boost words in the existing vocabulary. | ||
## Demo | ||
For example usage refer to our [Web demo application](https://github.com/Picovoice/cheetah/tree/master/demo/web). |
@@ -18,2 +18,12 @@ const fs = require('fs'); | ||
const testDataSource = join( | ||
__dirname, | ||
'..', | ||
'..', | ||
'..', | ||
'resources', | ||
'.test', | ||
'test_data.json' | ||
); | ||
const sourceDirectory = join( | ||
@@ -34,2 +44,4 @@ __dirname, | ||
fs.copyFileSync(testDataSource, join(testDirectory, 'test_data.json')); | ||
fs.mkdirSync(join(fixturesDirectory, 'audio_samples'), { recursive: true }); | ||
@@ -36,0 +48,0 @@ fs.readdirSync(join(sourceDirectory, 'audio_samples')).forEach(file => { |
@@ -455,3 +455,3 @@ /* | ||
const memoryBufferUint8 = new Uint8Array(memory.buffer); | ||
let memoryBufferUint8 = new Uint8Array(memory.buffer); | ||
@@ -555,3 +555,3 @@ const pvError = new PvError(); | ||
const memoryBufferView = new DataView(memory.buffer); | ||
let memoryBufferView = new DataView(memory.buffer); | ||
@@ -564,2 +564,11 @@ const status = await pv_cheetah_init( | ||
objectAddressAddress); | ||
if (memoryBufferView.buffer.byteLength === 0) { | ||
memoryBufferView = new DataView(memory.buffer); | ||
} | ||
if (memoryBufferUint8.buffer.byteLength === 0) { | ||
memoryBufferUint8 = new Uint8Array(memory.buffer); | ||
} | ||
if (status !== PV_STATUS_SUCCESS) { | ||
@@ -605,3 +614,3 @@ const messageStack = await Cheetah.getMessageStack( | ||
version: version, | ||
objectAddress: objectAddress, | ||
@@ -632,3 +641,3 @@ inputBufferAddress: inputBufferAddress, | ||
const status = await pv_get_error_stack(messageStackAddressAddressAddress, messageStackDepthAddress); | ||
if (status != PvStatus.SUCCESS) { | ||
if (status !== PvStatus.SUCCESS) { | ||
throw pvStatusToException(status, "Unable to get Cheetah error state"); | ||
@@ -635,0 +644,0 @@ } |
@@ -12,4 +12,4 @@ /* | ||
import { PvModel } from "@picovoice/web-utils"; | ||
import { CheetahError } from "./cheetah_errors"; | ||
import { PvModel } from '@picovoice/web-utils'; | ||
import { CheetahError } from './cheetah_errors'; | ||
@@ -38,7 +38,7 @@ export enum PvStatus { | ||
/** @defaultValue 1.0 */ | ||
endpointDurationSec?: number | ||
endpointDurationSec?: number; | ||
/** @defaultValue false */ | ||
enableAutomaticPunctuation?: boolean; | ||
/** @defaultValue undefined */ | ||
processErrorCallback?: (error: CheetahError) => void | ||
processErrorCallback?: (error: CheetahError) => void; | ||
}; | ||
@@ -69,3 +69,3 @@ | ||
command: 'flush'; | ||
} | ||
}; | ||
@@ -77,6 +77,6 @@ export type CheetahWorkerReleaseRequest = { | ||
export type CheetahWorkerRequest = | ||
CheetahWorkerInitRequest | | ||
CheetahWorkerProcessRequest | | ||
CheetahWorkerFlushRequest | | ||
CheetahWorkerReleaseRequest; | ||
| CheetahWorkerInitRequest | ||
| CheetahWorkerProcessRequest | ||
| CheetahWorkerFlushRequest | ||
| CheetahWorkerReleaseRequest; | ||
@@ -90,27 +90,35 @@ export type CheetahWorkerFailureResponse = { | ||
export type CheetahWorkerInitResponse = CheetahWorkerFailureResponse | { | ||
command: 'ok'; | ||
frameLength: number; | ||
sampleRate: number; | ||
version: string; | ||
}; | ||
export type CheetahWorkerInitResponse = | ||
| CheetahWorkerFailureResponse | ||
| { | ||
command: 'ok'; | ||
frameLength: number; | ||
sampleRate: number; | ||
version: string; | ||
}; | ||
export type CheetahWorkerProcessResponse = CheetahWorkerFailureResponse | { | ||
command: 'ok'; | ||
cheetahTranscript: CheetahTranscript; | ||
}; | ||
export type CheetahWorkerProcessResponse = | ||
| CheetahWorkerFailureResponse | ||
| { | ||
command: 'ok'; | ||
cheetahTranscript: CheetahTranscript; | ||
}; | ||
export type CheetahWorkerFlushResponse = CheetahWorkerFailureResponse | { | ||
command: 'ok'; | ||
cheetahTranscript: CheetahTranscript; | ||
}; | ||
export type CheetahWorkerFlushResponse = | ||
| CheetahWorkerFailureResponse | ||
| { | ||
command: 'ok'; | ||
cheetahTranscript: CheetahTranscript; | ||
}; | ||
export type CheetahWorkerReleaseResponse = CheetahWorkerFailureResponse | { | ||
command: 'ok'; | ||
}; | ||
export type CheetahWorkerReleaseResponse = | ||
| CheetahWorkerFailureResponse | ||
| { | ||
command: 'ok'; | ||
}; | ||
export type CheetahWorkerResponse = | ||
CheetahWorkerInitResponse | | ||
CheetahWorkerProcessResponse | | ||
CheetahWorkerFlushResponse | | ||
CheetahWorkerReleaseResponse; | ||
| CheetahWorkerInitResponse | ||
| CheetahWorkerProcessResponse | ||
| CheetahWorkerFlushResponse | ||
| CheetahWorkerReleaseResponse; |
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
5719208
45
204
24487
Updated@picovoice/web-utils@=1.4.3