Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 09-25-2022, 05:52 AM   #1
okabekudo
Junior Member
okabekudo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2022
Device: Kobo Aura One, Boox Onyx Poke 3, Kindle Basic
Where in the code is word highlighting for text-to-speech handled?

I'm trying to set up microsoft azure with the read aloud feature. It does read the word but it's not highlighted. I'm on linux so I have my azure python script configured as a speech-dispatcher module. I understand that the module should support word highlighting, but with every module where that function actually works it is the same highlight color (blue) which I guess would indicate that the highlighting is done by the ebook viewer and not the tts-engine itself? Where in the source code does that happen? I've looked at src/calibre/gui2/tts and src/calibre/gui2/viewer but I'm not finding anything related to "highlight spoken word" (actually finding anything fast in the source code when comments are absent is difficult). Could you please lead me to the right destination I'd be very thankful.
okabekudo is offline   Reply With Quote
Old 09-25-2022, 08:08 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
grep for mark_word_being_spoken
kovidgoyal is online now   Reply With Quote
Advert
Old 09-25-2022, 08:59 AM   #3
okabekudo
Junior Member
okabekudo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2022
Device: Kobo Aura One, Boox Onyx Poke 3, Kindle Basic
Alright awesome, thanks Kovid. Turns out I wasn't even looking in the right directories.
okabekudo is offline   Reply With Quote
Old 09-25-2022, 09:51 AM   #4
okabekudo
Junior Member
okabekudo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2022
Device: Kobo Aura One, Boox Onyx Poke 3, Kindle Basic
Did I interpret the source code correctly that a spoken word is only highlighted if it is of the type 'mark'? If yes I couldn't really find how to define a mark. I only found class EventType where mark gets an automatic value assigned. Obviously git grep mark returns way too much.
okabekudo is offline   Reply With Quote
Old 09-25-2022, 10:04 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
look at find.pyj marks are defined by tts_word_regex
kovidgoyal is online now   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
highlighting text overrides original color body text obi_cruz Viewer 3 01-09-2021 07:58 PM
Is There Code to Stop Text-to-Speech at End of Passage? BSquared18 Kindle Developer's Corner 0 06-24-2011 02:33 PM
How to make Amazon Kindle Text to Speech skip over some text xsaero00 Kindle Developer's Corner 3 06-18-2011 07:09 PM
PRS-650 Setting for highlighting whole word not just letters diddy Sony Reader 9 03-04-2011 07:41 AM
Text to Speech - Word Missup. DrakeShockFire Amazon Kindle 6 02-10-2010 12:06 AM


All times are GMT -4. The time now is 12:08 PM.


MobileRead.com is a privately owned, operated and funded community.