Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 23 with logic from tutorial
  • Loading branch information
LHJE committed Jul 7, 2021
commit 26f4a80c75cc74b1ee14e0ac6d5102fe0af20e1f
11 changes: 11 additions & 0 deletions 23 - Speech Synthesis/index-START.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ <h1>The Voiceinator 5000</h1>
const options = document.querySelectorAll('[type="range"], [name="text"]');
const speakButton = document.querySelector('#speak');
const stopButton = document.querySelector('#stop');
msg.text = document.querySelector('[name="text"]').value;

function populateVoices() {
voices = this.getVoices();
const voiceOptions = voices
.map(voice => `<option value="${voice.name}">${voice.name}
</option>`)
}

speechSynthesis.addEventListener('voiceschanged', populateVoices);

</script>

</body>
Expand Down