| 40 | const pipe = await module.default.getPipeline(TASK, model); | 40 | const pipe = await module.default.getPipeline(TASK, model); |
| 41 | const wav = getWaveFile(audio); | 41 | const wav = getWaveFile(audio); |
| 42 | const start = performance.now(); | 42 | const start = performance.now(); |
| 43 | const result = await pipe(wav, { language: lang || null }); | 43 | const result = await pipe(wav, { language: lang || null, task: 'transcribe' }); |
| 44 | const end = performance.now(); | 44 | const end = performance.now(); |
| 45 | console.log(`Execution duration: ${(end - start) / 1000} seconds`); | 45 | console.log(`Execution duration: ${(end - start) / 1000} seconds`); |
| 46 | console.log('Transcribed audio:', result.text); | 46 | console.log('Transcribed audio:', result.text); |