woensdag 23 november 2022

Text to Speech in de webbrowser

let dutchVoice;

function talk() {
    var msg = new SpeechSynthesisUtterance();
    msg.text = "Een tekst laten uitspreken door de webbrowser, lijkt veel vriendelijker.";
    msg.lang = "nl-NL";
    msg.voice = dutchVoice;
    window.speechSynthesis.speak(msg);
}

function checkDutchVoices() {
  if (dutchVoice) {
     return;
  }

    const voices = window.speechSynthesis.getVoices();
    let ned = [];
        for (let voice of voices) {
      if (voice.lang === 'nl-NL') {
          ned.push(voice);
      }
        //console.log(voice);
    }
    if (ned.length > 0) {
        dutchVoice = ned[ned.length-1];
      talk();
    }
}

window.speechSynthesis.onvoiceschanged = checkDutchVoices;

Demo in JSFiddle. Voer uit met Microsoft Edge.

 

dinsdag 22 november 2022

CSS containers!

Heel mooi dat je nu een max-size kunt zetten op een "container".

Zie deze youtube.

vrijdag 11 november 2022

Windows 11: Unblock multiple files

On Windows 11, I unpacked a zipfile and alle the file were "blocked". Visual studio could not handle some of them.

Solution: go to a parent node. Shift-rightclick on folder and "Open Powershell Window here".

Then: dir -Recurse | Unblock-File