A Pen by guyfedwards

This awesome code was written by guyfedwards, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright guyfedwards ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>A Pen by  guyfedwards</title>


  <button>Speak to me</button>

    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/guyfedwards/a-pen-by-guyfedwards-aBAkC */

function speak(){

  var msg = new SpeechSynthesisUtterance('Tally ho old chap, bloody good show');
  /*msg.voice = speechSynthesis.getVoices().filter(function(voice) { 
    return voie.name == 'Google UK English Male'; 
  var voices = window.speechSynthesis.getVoices();
  msg.default = false;
  msg.voice = voices[8]; 
  msg.voiceURI = 'native';


document.querySelector('button').addEventListener("click", speak, false);