[NFBCS] JAWS API/apictrl

Lewis Wood lewislwood at gmail.com
Thu Apr 28 15:39:57 UTC 2022


I just learned recently that crome natively supports speech synthesizer from
my Javascript30, I had a lot of years to catch up and it helped a lot.

Here is lesson 23 scripts: I hope this points you in a good direction.
Did not include the html, figured spam filter may kill this reply. But I am
sure you can figure them out.


const msg = new SpeechSynthesisUtterance();
  let voices = [];
  const voicesDropdown = document.querySelector('[name="voice"]');
  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();
    voicesDropdown.innerHTML = voices
      .filter(voice => voice.lang.includes('en'))
      .map(voice => `<option value="${voice.name}">${voice.name}
(${voice.lang})</option>`)
      .join('');
  }

  function setVoice() {
    msg.voice = voices.find(voice => voice.name === this.value);
    toggle();
  }

  function toggle(startOver = true) {
    speechSynthesis.cancel();
    if (startOver) {
      speechSynthesis.speak(msg);
    }
  }

  function setOption() {
    console.log(this.name, this.value);
    msg[this.name] = this.value;
    toggle();
  }

  speechSynthesis.addEventListener('voiceschanged', populateVoices);
  voicesDropdown.addEventListener('change', setVoice);
  options.forEach(option => option.addEventListener('change', setOption));
  speakButton.addEventListener('click', toggle);
  stopButton.addEventListener('click', () => toggle(false));


-----Original Message-----
From: NFBCS <nfbcs-bounces at nfbnet.org> On Behalf Of Ty Littlefield via NFBCS
Sent: Wednesday, April 27, 2022 8:26 PM
To: NFBCS at nfbnet.org
Cc: Ty Littlefield <tyler at tysdomain.com>
Subject: [NFBCS] JAWS API/apictrl

Hi all,

I'm working on a project that is going to require speaking text through
JAWS/NVDA. I know that the nvda controllers are available and accessible,
what I'm not totally sure of is the Jaws API for speech/braille. I know
there's a comm object, but I'm not sure if this is documented/legal to use,
and I don't want any issues to come from using this.


Is there any documentation/reference on either the jfwapi (I remember a
header/lib at one point), or the com object?

Thanks,



_______________________________________________
NFBCS mailing list
NFBCS at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for NFBCS:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/lewislwood%40gmail.com




More information about the NFBCS mailing list