From 1c57f5959db2652aa200f18f9f7e192bfbb2711a Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Mon, 28 Nov 2022 09:29:17 -0500 Subject: [PATCH 1/2] feat: export Endpointer interface (though it will go away) and make a release --- js/package.json | 2 +- js/soundswallower.d.ts | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/js/package.json b/js/package.json index 5676af5..ac8fdf1 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "soundswallower", - "version": "0.4.0", + "version": "0.4.2", "description": "An even smaller speech recognizer", "main": "soundswallower.js", "scripts": { diff --git a/js/soundswallower.d.ts b/js/soundswallower.d.ts index fa2666f..d211c93 100644 --- a/js/soundswallower.d.ts +++ b/js/soundswallower.d.ts @@ -11,7 +11,7 @@ export class Decoder { reinitialize_audio(): Promise; start(): Promise; stop(): Promise; - process(pcm: Float32Array|Uint8Array, no_search: boolean, full_utt: boolean): Promise; + process(pcm: Float32Array|Uint8Array, no_search?: boolean, full_utt?: boolean): Promise; get_hyp(): string; get_hypseg(): Array; get_alignment_json(start?: number, align_level?: number): Promise; @@ -22,6 +22,15 @@ export class Decoder { set_jsgf(jsgf_string: string, toprule?: string): Promise; set_align_text(text: string): Promise; } +export class Endpointer { + get_frame_size(): number; + get_frame_length(): number; + get_in_speech(): boolean; + get_speech_start(): number; + get_speech_end(): number; + process(frame: Float32Array): Float32Array; + end_stream(frame: Float32Array): Float32Array; +} export interface Transition { from: number; to: number; @@ -38,6 +47,10 @@ export interface SoundSwallowerModule extends EmscriptenModule { Decoder: { new(config?: Object): Decoder; } + Endpointer: { + new(sample_rate: number, frame_length?: number, + mode?: number, window?: number, ratio?: number): Endpointer; + } } declare const Module: EmscriptenModuleFactory; export default Module; From 5d07c98e337355d7e011f1059ff80b20d6b383d6 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Mon, 28 Nov 2022 09:30:23 -0500 Subject: [PATCH 2/2] chore: correct version --- js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/package.json b/js/package.json index ac8fdf1..7787f4d 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "soundswallower", - "version": "0.4.2", + "version": "0.4.1", "description": "An even smaller speech recognizer", "main": "soundswallower.js", "scripts": {