a .node addon for whisper
npm install whisper-node-addonwhisper-node-addon is currently in early experimental phase. APIs may change breakingly and production use is not recommended!bash
npm i whisper-node-addon
`
đ Usage
`javascript
import { transcribe } from 'whisper-node-addon/dist'
const modelPath = path.resolve('./resources/models/ggml-base.bin')
// Transcribe audio
try {
const result = await transcribe({
language: 'zh',
model: modelPath,
fname_inp: tempFilePath,
translate: false
})
return result.reduce((pre, cur) => pre + (cur[2] || ''), '')
} catch (err) {
console.error('Error:', err)
return ''
}
`
đ Build from Source (Optional)
`bash
Build binaries for all platforms
npm run build
``