VideoChain-API / src /speechToText /speechToTextWithWhisperLib.mts
jbilcke-hf's picture
jbilcke-hf HF Staff
test with whisper cpp (warning: might break the prod server)
4ddd98f
raw
history blame
495 Bytes
import { nodewhisper } from "nodejs-whisper"
import { convertMp3ToWavFilePath } from "../utils/convertMp3ToWavFilePath.mts"
export async function speechToText(sound: string): Promise<string> {
console.log("/speechToText: calling whisper binding..")
// TODO try a wav? audio/wav
const wavFilePath = await convertMp3ToWavFilePath(sound)
const result = await nodewhisper(wavFilePath, {
modelName: 'base.en', //Downloaded models name
})
console.log(result)
return "TODO"
}