ASR Debugging
All checks were successful
Publish Library / Build NPM Project (push) Successful in 43s
Publish Library / Tag Version (push) Successful in 17s

This commit is contained in:
2025-12-13 22:59:23 -05:00
parent d69bea3b38
commit 31d9ee4390
2 changed files with 3 additions and 1 deletions

View File

@@ -46,6 +46,8 @@ export class Ai {
const m = await this.downloadAsrModel(model);
const name = Math.random().toString(36).substring(2, 10) + '-' + path.split('/').pop() + '.txt';
const output = Path.join(this.options.whisper.temp || '/tmp', name);
console.log(this.options.whisper?.model + ' -> ' + this.whisperModel);
console.log(`rm -f ${output} && ${this.options.whisper.binary} -nt -np -m ${m} -f ${path} -otxt -of ${output}`);
await $`rm -f ${output} && ${this.options.whisper.binary} -nt -np -m ${m} -f ${path} -otxt -of ${output}`;
return fs.readFile(output, 'utf-8').then(text => text?.trim() || null)
.finally(() => fs.rm(output, {force: true}).catch(() => {}));