webui: fix slow mic stop and WAV encode (#22480)

* webui: instant mic stop, race-free recorder restart

* webui: faster WAV PCM encode via hoisted channels and Int16Array

* chore: update webui build output

* webui: drop setTimeout(0) hack and harden cancelRecording

* chore: update webui build output
This commit is contained in:
Pascal
2026-04-29 12:58:35 +02:00
committed by GitHub
parent 1cbc846eba
commit 59237bfbbc
3 changed files with 138 additions and 107 deletions
@@ -527,16 +527,15 @@
}
if (isRecording) {
isRecording = false;
try {
const audioBlob = await audioRecorder.stopRecording();
const wavBlob = await convertToWav(audioBlob);
const audioFile = createAudioFile(wavBlob);
onFilesAdd?.([audioFile]);
isRecording = false;
} catch (error) {
console.error('Failed to stop recording:', error);
isRecording = false;
}
} else {
try {