Reply to post

Hot!Silencing a whole paragraph with "Edit Speech"

Author
davidpomerenke
User
  • Total Posts : 0
  • Reward points: 0
  • Joined: 2021/03/25 02:44:52
  • Status: offline
2021/03/25 06:02:25 (permalink)

Silencing a whole paragraph with "Edit Speech"

Hi,
 
this is a really awesome app, thank you so much for developing it! Due to narcolepsy I have trouble reading printed books, and this app enables me to listen to books that are not published as audiobooks, expanding the range of books that is open to me.
 
I have a small question / feature request: I am listening to a semi-scientific book (originally PDF, converted with @Voice Aloud Reader) with lots of figures with captions. The figures themselves mostly get converted to images automatically, which is pretty cool. (When they contain text, they often don't get converted to pictures but get transcribed in a weird way, but this is probably hard to fix.) The captions of the figures are even kind of "recognized" as captions: They are converted to a smaller font size. Now these captions disturb the flow of the text, as the figures ae often positioned at the top of a page, and so the captions often just interrupt a sentence, which I find annoying. It is not crucial for me to have the captions read out, since I will study the figures separately anyways. So what I would like to do is to silence them (ideally even in such a way that there is no break in the sentence that is interrupted by the figure).
 
One approach to do this is to just crop the pages manually and remove the figures (or mark them as pictures) when adding the PDF to @Voice Aloud Reader; this is lots of tedious work, so as a lazy person, I would prefer to avoid it.
 
The better approach is to use the "Edit Speech" feature with regex: A simple expression like "Figure\s\d.*" identifies the figure captions well (and this should be transferable to other books). But, since the "Edit Speech" feature is restricted to work only on a single sentence, it will only remove the first sentence of the caption, and the rest will still be read aloud, interrupting the sentence in the main text.
 
Is there currently a way to silence the whole paragraph consisting of multiple sentences? If not, do you think there is a possible world where you would add such a feature in the future? :)
 
Best,
 
David

3 Replies Related Threads

    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: online
    Re: Silencing a whole paragraph with "Edit Speech" 2021/03/25 10:24:55 (permalink)
    Edit speech - as you correctly observed - is limited to single sentences, or rather - to the text that @Voice picks to send to the TTS engine at one time (the yellow highlight). There is no way to enhance it further. There is a way to edit (remove or replace) larger fragments with specially defined filter files, but it's undocumented. There is no user interface for creating them, they need to be created manually as JSON files and placed in Filters sub-directory (to be created manually as well) under the main @Voice app folder.
     
    Maybe if you could send me (best as email attachments, not forum posts) the original PDF file and/or the converted text or epub file, and told me exactly what needs to be removed, I could suggest the best way to proceed, maybe send you a JSON filter file to install, maybe suggest some other approach. Each such situation is different and hard to say in advance what will really work...
     
    Greg
    davidpomerenke
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2021/03/25 02:44:52
    • Status: offline
    Re: Silencing a whole paragraph with "Edit Speech" 2021/03/25 14:15:54 (permalink)
    Hi,
     
    thanks for your answer!
     
    I found the prior post https://hyperionics.com/forum2/tm.aspx?m=11939, and tried to apply it, only partially successfully.
     
    So I created a JSON file (see below) and a TXT filter file, and the filter file is successfully applied -- however, it seems that it still only works for one sentence at most.
     
    So I played around a bit with the other attributes in the JSON file.
     
    When I open the epub created by @Audio in Calibre, I find the following HTML for figure captions:
     
    <p class='fs37'><b>Figure 1.27</b> The trajectories of a robot
    successfully evolved in simulation (adapted from Keymeulen et al.
    1997). The robot manages to reach the target object (whose position
    is denoted by the X) without hitting the obstacles (represented by
    the gray boxes) or touching the walls of the arena from all of the
    predefined starting positions (except those that are located within
    an obstacle).</p>
     
    So I tried:

    {
      "extractor": "full",
      "disabled": false,
      "file": ".*",
      "title": "My Filter",
      "speechFilt": "my-replace-eng.txt",
      "nodeRemove": [
        { "tag": "p", "attrib": [{ "name": "class", "val": "fs37" }]},
      ],
      "edit": [
        { "repeat": true, "from": "Figure", "subst": "" }
      ]
    }
     
    But this does not have an effect. I am probably using the JSON in some wrong way -- could you perhaps explain a bit how it is used correctly? :)
    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: online
    Re: Silencing a whole paragraph with "Edit Speech" 2021/03/27 16:28:59 (permalink)
    I'm not sure if I apply these filters also to EPUB files, would have to consult the code. It would be best if you could send me one or several files that you want to read aloud, and explain what exactly do you want to remove from there, and where, or how to replace the text. I could then try to create the filter for you, test it, if it must be applied to EPUBs too, I would probably need to modify slightly the app code and make a new release, then you'd be ready to go... It would be best to send me this stuff by email, address: atVoice AT this website domain, or any other address on the Contacts page here.
     
    Greg
    Jump to:
    © 2021 APG vNext Commercial Version 5.1