mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-01-06 20:48:41 +00:00
58210d6a76
* node : fix compilation and update examples * node : fix readme * Update addon.node test
26 lines
657 B
JavaScript
26 lines
657 B
JavaScript
const path = require("path");
|
|
const { whisper } = require(path.join(
|
|
__dirname,
|
|
"../../../build/Release/addon.node"
|
|
));
|
|
const { promisify } = require("util");
|
|
|
|
const whisperAsync = promisify(whisper);
|
|
|
|
const whisperParamsMock = {
|
|
language: "en",
|
|
model: path.join(__dirname, "../../../models/ggml-base.en.bin"),
|
|
fname_inp: path.join(__dirname, "../../../samples/jfk.wav"),
|
|
use_gpu: true,
|
|
no_timestamps: false,
|
|
};
|
|
|
|
describe("Run whisper.node", () => {
|
|
test("it should receive a non-empty value", async () => {
|
|
let result = await whisperAsync(whisperParamsMock);
|
|
|
|
expect(result.length).toBeGreaterThan(0);
|
|
}, 10000);
|
|
});
|
|
|