Safari Web Speech boundary events for Spanish content on OS X

I am on Monterey 12.1/Safari 15.2 and am seeing a problem with Web Speech boundary events in that if my utterance text has spaces in it then the tracking index only reflects half of those spaces rounded down. So if the first word is prefix by 1 space then no problem, but with 2 it acts like there's just 1 space and 3-4=>2, 5-6=>3 spaces with respect to the character index during tracking.

This is not an issue for English content (and didn't use to be an issue for Spanish content).

I have attached a test page as an example.

Load it up, choose a Spanish voice pack (e.g. Juan), type in 'Yo tengo un gato y un perro.' (Yeah, I know my Spanish is impressive.) and try clicking Speak and adding spaces. You'll note the character indices are the same for 1 or 2 spaces... etc.

P.S. I can't find an appropriate tag for Speech Synthesis related issues.

Replies

Hey there! Could you also share the javascript for the above example?

The file was self-contained, but I guess this website doesn't handle sharing a file properly? Trying to add as a .txt file.

Well, that didn't work... let's try this...

Ok, I give up. How do I share a self-contained HTML file that contains JavaScript with you on this site???

...and the reality is all you need to do is submit an utterance to the web speech engine with 2+ preceding spaces and see what comes back via the onboundary event. There's nothing unusual here.