2023-03-29 20:59:17 +00:00
|
|
|
const path = require("path");
|
|
|
|
const { whisper } = require(path.join(
|
|
|
|
__dirname,
|
|
|
|
"../../../build/Release/whisper-addon"
|
|
|
|
));
|
|
|
|
const { promisify } = require("util");
|
|
|
|
|
|
|
|
const whisperAsync = promisify(whisper);
|
2023-02-05 13:02:08 +00:00
|
|
|
|
|
|
|
const whisperParamsMock = {
|
2023-03-29 20:59:17 +00:00
|
|
|
language: "en",
|
|
|
|
model: path.join(__dirname, "../../../models/ggml-base.en.bin"),
|
|
|
|
fname_inp: path.join(__dirname, "../../../samples/jfk.wav"),
|
2023-11-06 09:04:24 +00:00
|
|
|
use_gpu: true,
|
2023-02-05 13:02:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
describe("Run whisper.node", () => {
|
2023-04-30 15:51:57 +00:00
|
|
|
test("it should receive a non-empty value", async () => {
|
|
|
|
let result = await whisperAsync(whisperParamsMock);
|
2023-02-05 13:02:08 +00:00
|
|
|
|
2023-04-30 15:51:57 +00:00
|
|
|
expect(result.length).toBeGreaterThan(0);
|
|
|
|
}, 10000);
|
2023-02-05 13:02:08 +00:00
|
|
|
});
|
2023-04-30 15:51:57 +00:00
|
|
|
|