expose diarization support checking function
All checks were successful
Publish Library / Build NPM Project (push) Successful in 25s
Publish Library / Tag Version (push) Successful in 5s

This commit is contained in:
2026-02-12 11:55:29 -05:00
parent 54730a2b9a
commit 46ae0f7913
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ export class Audio {
return lines.join('\n');
}
private async isPyannoteInstalled(): Promise<boolean> {
async canDiarization(): Promise<boolean> {
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<any[]> {
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