Compare commits

...

1 Commits

Author SHA1 Message Date
cec892563e Whisper ASR
All checks were successful
Publish Library / Build NPM Project (push) Successful in 33s
Publish Library / Tag Version (push) Successful in 5s
2026-02-21 01:03:25 -05:00
2 changed files with 2 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@ztimson/ai-utils", "name": "@ztimson/ai-utils",
"version": "0.7.10", "version": "0.7.11",
"description": "AI Utility library", "description": "AI Utility library",
"author": "Zak Timson", "author": "Zak Timson",
"license": "MIT", "license": "MIT",

View File

@@ -12,7 +12,7 @@ export class Audio {
constructor(private ai: Ai) { constructor(private ai: Ai) {
if(ai.options.whisper) { 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(); this.downloadAsrModel();
} }
@@ -40,7 +40,6 @@ print(json.dumps(segments))
this.downloadAsrModel(opts.model).then(m => { this.downloadAsrModel(opts.model).then(m => {
let output = ''; let output = '';
const args = [opts.diarization ? '-owts' : '-nt', '-m', m, '-f', file]; const args = [opts.diarization ? '-owts' : '-nt', '-m', m, '-f', file];
console.log(<string>this.ai.options.whisper + ' ' + args.join(' '))
proc = spawn(<string>this.ai.options.whisper, args, {stdio: ['ignore', 'pipe', 'ignore']}); proc = spawn(<string>this.ai.options.whisper, args, {stdio: ['ignore', 'pipe', 'ignore']});
proc.on('error', (err: Error) => reject(err)); proc.on('error', (err: Error) => reject(err));
proc.stdout.on('data', (data: Buffer) => output += data.toString()); proc.stdout.on('data', (data: Buffer) => output += data.toString());