Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
adding code to synthesis demo to detect and highlight default voice
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavidmills committed Nov 27, 2015
1 parent e766a1e commit 6c4948e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions speak-easy-synthesis/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ var voices = synth.getVoices();
for(i = 0; i < voices.length ; i++) {
var option = document.createElement('option');
option.textContent = voices[i].name + ' (' + voices[i].lang + ')';

if(voices[i].default) {
option.textContent += ' -- DEFAULT';
}

option.setAttribute('data-lang', voices[i].lang);
option.setAttribute('data-name', voices[i].name);
voiceSelect.appendChild(option);
Expand Down

0 comments on commit 6c4948e

Please sign in to comment.