refac: call

This commit is contained in:
Timothy J. Baek 2024-06-08 03:27:56 -07:00
parent 5cbb79fa6e
commit 063e1ee46c

View File

@ -139,7 +139,17 @@
const audio = assistantAudio[idx];
audioElement.src = audio.src; // Assume `assistantAudio` has objects with a `src` property
audioElement.play();
audioElement.muted = true;
audioElement
.play()
.then(() => {
audioElement.muted = false;
})
.catch((error) => {
toast.error(error);
});
audioElement.onended = async (e) => {
await new Promise((r) => setTimeout(r, 300));