From 46ae0f7913f87c16c00afd787a5e222de628fe87 Mon Sep 17 00:00:00 2001 From: ztimson Date: Thu, 12 Feb 2026 11:55:29 -0500 Subject: [PATCH] expose diarization support checking function --- package.json | 2 +- src/audio.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6182527..45f6e19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/ai-utils", - "version": "0.6.0", + "version": "0.6.1", "description": "AI Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/audio.ts b/src/audio.ts index e5a540b..81811d5 100644 --- a/src/audio.ts +++ b/src/audio.ts @@ -33,7 +33,7 @@ export class Audio { return lines.join('\n'); } - private async isPyannoteInstalled(): Promise { + async canDiarization(): Promise { return new Promise((resolve) => { const proc = spawn('python3', ['-c', 'import pyannote.audio']); proc.on('close', (code: number) => resolve(code === 0)); @@ -42,7 +42,7 @@ export class Audio { } private async runDiarization(audioPath: string): Promise { - if(!await this.isPyannoteInstalled()) throw new Error('Pyannote is not installed: pip install pyannote.audio'); + if(!await this.canDiarization()) throw new Error('Pyannote is not installed: pip install pyannote.audio'); const script = ` import sys import json