![]() |
#1 |
Junior Member
![]() 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.
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
grep for mark_word_being_spoken
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() 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.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() 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.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |