Skip to content

Commit

Permalink
Reverted attempted audio fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
BadgerHobbs committed Nov 9, 2023
1 parent 2f2bfed commit e788469
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ class Assistant {

const blob = await response.blob();

const audioElement = document.createElement("audio");
audioElement.src = window.URL.createObjectURL(blob);
audioElement.onended = () => {
document.body.removeChild(audioElement);
const url = window.URL.createObjectURL(blob);
const audio = new Audio(url);

audio.onended = () => {
this.setState(State.WAITING);
};

this.setState(State.SPEAKING);
document.body.appendChild(audioElement);
audioElement.play();
audio.play();
} catch (error) {
console.error(error);
alert(`Error: ${error}`);
Expand Down

0 comments on commit e788469

Please sign in to comment.