From cec892563ed1fe94d430beb5decc027cf4b67803 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 21 Feb 2026 01:03:25 -0500 Subject: [PATCH] Whisper ASR --- package.json | 2 +- src/audio.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e689b1b..0ee9d1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/ai-utils", - "version": "0.7.10", + "version": "0.7.11", "description": "AI Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/audio.ts b/src/audio.ts index 2647036..69ea09f 100644 --- a/src/audio.ts +++ b/src/audio.ts @@ -12,7 +12,7 @@ export class Audio { constructor(private ai: Ai) { if(ai.options.whisper) { - this.whisperModel = ai.options.asr?.endsWith('.bin') ? ai.options.asr : ai.options.asr + '.bin'; + this.whisperModel = ai.options.asr || 'ggml-base.en.bin'; this.downloadAsrModel(); } @@ -40,7 +40,6 @@ print(json.dumps(segments)) this.downloadAsrModel(opts.model).then(m => { let output = ''; const args = [opts.diarization ? '-owts' : '-nt', '-m', m, '-f', file]; - console.log(this.ai.options.whisper + ' ' + args.join(' ')) proc = spawn(this.ai.options.whisper, args, {stdio: ['ignore', 'pipe', 'ignore']}); proc.on('error', (err: Error) => reject(err)); proc.stdout.on('data', (data: Buffer) => output += data.toString());