Closed willwade closed 1 year ago
Apple doesn't have gujarati, so mixing with this language isn't possible, Apple and azure support mixing only with the languages they have
Are you trying to say you can only get word by word highlighting with offline voices? Or at least with languages supported by offline voices
Apple do support gujariti keyboard
yes, it is, but Apple doesn't support playback of this voice.
@taananas - mind explaining how highlighting is working and where this bug is stemming from?
It looks to me like the 'sentence detection' is thrown off by the Gujarati characters.
It reads through what I would expect on paragraph mode, but jumps sentences on sentence mode.
we have no gujariti voice for apple and the speech service doesтэt return the word range
@taananas Do we need to use the speech service to get the word ranges? Can we not build that ourselves by seperating on space characters and on new lines and full stops etc?
Not creating an issue as it seems related. Its seems to not be able to understand two letter words, it gets stuck on them when playing through in word mode. Even when using an english voice and only using english characters
https://user-images.githubusercontent.com/1359202/223453549-acdd3dc7-0826-4da2-baf7-4764bd2f7914.mov
I've had a quick look but need to dig further. It looks like we need to handle the ranges differently between NSRanges and String Ranges and NSRanges account for all kinds of characters but string ranges dont.
I switched out this line:
let range = rangeOffset..<(rangeOffset + range.length)
let prepairText = text[range]
for
let prepairText = String(text.substring(with: range) ?? "default")
Which seemed to solve some of the issues, but the highlight still isn't quite right. I can have more of a look later
@taananas Do we need to use the speech service to get the word ranges? Can we not build that ourselves by seperating on space characters and on new lines and full stops etc?
it doesn't really affect, but you can try to find something else.
Fixed in v1.1.5
https://user-images.githubusercontent.com/229352/223460679-4768bb85-d544-436f-9a8b-75645310cdcf.mp4