nodejs-whisper
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -22,14 +22,15 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { verbose = false } = options; | ||
if (options.autoDownloadModelName) { | ||
yield (0, autoDownloadModel_1.default)(options.autoDownloadModelName, options.verbose); | ||
yield (0, autoDownloadModel_1.default)(options.autoDownloadModelName, verbose); | ||
} | ||
(0, utils_1.checkIfFileExists)(filePath); | ||
const outputFilePath = yield (0, utils_1.convertToWavType)(filePath, options.verbose); | ||
const outputFilePath = yield (0, utils_1.convertToWavType)(filePath, verbose); | ||
(0, utils_1.checkIfFileExists)(outputFilePath); | ||
const command = (0, WhisperHelper_1.constructCommand)(outputFilePath, options); | ||
if (options.verbose) { | ||
if (verbose) { | ||
console.log(`[Nodejs-whisper] Executing command: ${command}\n`); | ||
} | ||
const transcript = yield (0, whisper_1.executeCppCommand)(command, options.verbose); | ||
if (transcript.length === 0) { | ||
const transcript = yield (0, whisper_1.executeCppCommand)(command, verbose); | ||
if (!transcript) { | ||
throw new Error('Something went wrong while executing the command.'); | ||
@@ -36,0 +37,0 @@ } |
{ | ||
"name": "nodejs-whisper", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Node bindings for OpenAI's Whisper. Optimized for CPU.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
8356
5336113