File size: 495 Bytes
4ddd98f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

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"

}