diff --git a/index.html b/index.html index 9126097..e2fe774 100644 --- a/index.html +++ b/index.html @@ -223,9 +223,12 @@ async function doCompare(blob, originalText, duration) { }, 150); let whisperResult, phon; try { + const phonTimeout = new Promise(resolve => + setTimeout(() => resolve({ pitchHz: 0, pitchStability: 0, voiceClarity: 0, phonScore: 0 }), 15000) + ); [whisperResult, phon] = await Promise.all([ transcribe(blob), - phoneticAnalysis(blob) + Promise.race([phoneticAnalysis(blob), phonTimeout]) ]); } catch(e) { clearInterval(timerId);