Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-13-2018, 08:29 AM   #1
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,307
Karma: 14277313
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] TTS - Windows TTS output plugin

Released: May 13, 2018
Current Version: "0.1.0"

This plugin allows you to generate MP3 files of all files selected in the Book View window. (To select all files, click the Text folder.)

Note that this plugin has not been optimized for speed. If you want to generate mp3 files for a whole book, use jackie_w's TTS to MP3 Calibre plugin, which is two to three times faster than my plugin.

Credits: This plugin uses Joshua Milas's SAPI5 TTS library for generating WAV files and LAME for generating MP3 files.

System requirements

This plugin requires Windows 7 or higher and Sigil 0.8.9 or higher. If you're using an external Python 3 interpreter, you'll need to install bs4, tts and comtypes. (Note that this plugin does not work with Linux and macOS machines.)

Installation

1. Select Manage Plugins from the Plugins menu. Make sure that Use Bundled Python is checked. (If you're using an older Sigil version, select a Python 3 interpreter and install bs4, tts and comtypes.)
2. Click Add Plugin and select TTS_v0.1.0.zip. This will install the TTS plugin, which you can select via Plugins > Output > TTS.

Settings

The plugin doesn't come with a settings dialog box. However, advanced users can change some settings by adding/editing the following TTS.json entries.

Code:
 "rate": 0,
Add this entry with an integer value between -10 and 10 to modify the speech rate (default = 0).

Code:
  "desktop_folder": "C:\\MyFolder",
Change this entry, if you don't want the plugin to write MP3 files to the Desktop folder. (Note that you'll have to use two backslashes.)

Installing additional TTS voices

Advanced Windows users can install additional Catalan, Danish, German, English, Spanish, Finnish, French, Italian, Japanese, Korean, Norwegian, Dutch, Polish, Portuguese, Russian, Swedish and Chinese Microsoft Speech Platform voices. For details see this website.

If you have Windows 10 you can also enable hidden Cortana voices, e.g., Microsoft Mark and Microsoft Eva. For more information see this website. Make sure to check the following registry key before importing the registry files provided by the website!

Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens
License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip TTS_v0.1.0.zip (862.1 KB, 135 views)

Last edited by Doitsu; 06-17-2018 at 12:31 PM.
Doitsu is offline   Reply With Quote
Old 05-13-2018, 08:31 PM   #2
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 11,284
Karma: 10572868
Join Date: Mar 2012
Location: Sydney Australia
Device: none
This could be useful. At the moment I achieve a similar result using Balabolka, but I'm always looking to reduce my toolset.

Could there be an option to save the MP3 alongside the EPUB from which it was created? FX: if the EPUB is at D:\Ebooks\Fred Bloggs - Hills at Dawn.epub, then the MP3 would be saved at D:\Ebooks\Fred Bloggs - Hills at Dawn.mp3

BR
BetterRed is offline   Reply With Quote
Advert
Old 05-14-2018, 02:00 AM   #3
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,307
Karma: 14277313
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
Could there be an option to save the MP3 alongside the EPUB from which it was created?
Unfortunately, the epub file name isn't accessible via the plugin API. I.e., the plugin doesn't know where the epub file is located.
Doitsu is offline   Reply With Quote
Old 05-14-2018, 04:43 AM   #4
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 11,284
Karma: 10572868
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Fair 'nuff, bit of a bummer tho'.

"Any chance of re-shaping it into a calibre Conversion plugin?" he asked half-jokingly.

I'm away from my base, so I can't suck it and see. When it saves to the desktop does it use the EPUB file name, and what happens if the EPUB has just been created in Sigil, perhaps via an Import plugin, and hasn't been saved?

BR
BetterRed is offline   Reply With Quote
Old 05-14-2018, 05:30 AM   #5
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,307
Karma: 14277313
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
"Any chance of re-shaping it into a calibre Conversion plugin?" he asked half-jokingly.
Unfortunalely, I'm not familiar with the file conversion functions of the Calibre API. (I was only able to create my Calibre EpubCheck Editor plugin, because Kovid Goyal helped me a lot.) The actual TTS/MP3 conversion is trivial, but integrating it into the Calibre GUI would take me forever.
Maybe you should ask about it in the Calibre Plugin Ideas thread. (I'm pretty sure it'd take a Calibre Plugin developer less than an hour to hammer out the code.)

Quote:
Originally Posted by BetterRed View Post
I'm away from my base, so I can't suck it and see. When it saves to the desktop does it use the EPUB file name, and what happens if the EPUB has just been created in Sigil, perhaps via an Import plugin, and hasn't been saved?
The plugin will use the value of the title metadata entry. If the title metadata entry is missing, it'll use Untitled as the folder name. (BTW, new epubs created with Sigil 0.9.x will have a [Title here] default title entry.)
Doitsu is offline   Reply With Quote
Advert
Old 05-14-2018, 12:54 PM   #6
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,101
Karma: 1931746
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Doitsu View Post
Unfortunately, the epub file name isn't accessible via the plugin API. I.e., the plugin doesn't know where the epub file is located.
I think it will be in the next release. I thought I added that to master already but I could be wrong.
KevinH is offline   Reply With Quote
Old 05-14-2018, 01:56 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 19,180
Karma: 99356142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I think it will be in the next release. I thought I added that to master already but I could be wrong.
I thought the same thing, but I never got around to looking.

Indeed you did add it: https://github.com/Sigil-Ebook/Sigil...1cb6f07155f055

bk.get_epub_filepath() will be in the next release of Sigil
DiapDealer is online now   Reply With Quote
Old 05-18-2018, 09:14 AM   #8
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,611
Karma: 11060000
Join Date: Sep 2009
Location: UK
Device: Sony:PRS-350, Kobo:Aura6"/H2O/GloHD/KA1/ClaraHD/Forma
Quote:
Originally Posted by Doitsu View Post
This plugin allows you to generate MP3 files of all files selected in the Book View window.
Thanks for making this available. I've been very interested in TTS for many years. You've piqued my interest in creating some kind of TTS-to-MP3 calibre plugin based on your initial ideas. Programming playtime for me!

In these days of paid-for audiobook subscriptions I'm not sure how niche computer-generated TTS is. However, if I come up with anything useful, would you be OK with me making it available in the calibre plugin forum? Obviously I would credit you for the original work.

Quote:
Originally Posted by BetterRed View Post
"Any chance of re-shaping it into a calibre Conversion plugin?" he asked half-jokingly.
No promises yet but, if I do manage to create something workable, would you be willing to play guinea-pig?
jackie_w is offline   Reply With Quote
Old 05-18-2018, 09:45 AM   #9
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,307
Karma: 14277313
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by jackie_w View Post
However, if I come up with anything useful, would you be OK with me making it available in the calibre plugin forum?
Feel free to create a similar Calibre plugin. (Since I used a Python 3-only TTS library, you'll probably have to use pyttsx.)
Doitsu is offline   Reply With Quote
Old 05-18-2018, 10:09 AM   #10
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,611
Karma: 11060000
Join Date: Sep 2009
Location: UK
Device: Sony:PRS-350, Kobo:Aura6"/H2O/GloHD/KA1/ClaraHD/Forma
Quote:
Originally Posted by Doitsu View Post
Feel free to create a similar Calibre plugin. (Since I used a Python 3-only TTS library, you'll probably have to use pyttsx.)
I'm hoping to be able to build the few SAPI interface calls required from win32com which is already included in calibre, e.g. replace
Code:
voice = comtypes.client.CreateObject('Sapi.SpVoice')
with
Code:
voice = win32com.client.Dispatch("SAPI.SpVoice")
Initial testing seems OK, but this is why I don't want to make any promises yet.

ETA: Also, I'm currently favouring a calibre User Interface type of plugin rather than a calibre Editor plugin. Mainly because it has full access to calibre library metadata rather than just the current OPF contents. It would also make it easier to extend the functionality (at a later date) to processing multiple books at a time.

Last edited by jackie_w; 05-18-2018 at 10:15 AM. Reason: ETA
jackie_w is offline   Reply With Quote
Old 05-18-2018, 08:50 PM   #11
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 11,284
Karma: 10572868
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by BetterRed View Post
"Any chance of re-shaping it into a calibre Conversion plugin?" he asked half-jokingly.
Quote:
Originally Posted by jackie_w View Post
No promises yet but, if I do manage to create something workable, would you be willing to play guinea-pig?
Sure but it won't be extensive testing, we've outsourced most of this sort of stuff to a Unity development shop.

Quote:
Originally Posted by jackie_w View Post
ETA: Also, I'm currently favouring a calibre User Interface type of plugin rather than a calibre Editor plugin. Mainly because it has full access to calibre library metadata rather than just the current OPF contents. It would also make it easier to extend the functionality (at a later date) to processing multiple books at a time.
Why not a Conversion (format-shifting) plugin, then in the longer term you could consider per book settings.

BR
BetterRed is offline   Reply With Quote
Old 05-18-2018, 10:13 PM   #12
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,611
Karma: 11060000
Join Date: Sep 2009
Location: UK
Device: Sony:PRS-350, Kobo:Aura6"/H2O/GloHD/KA1/ClaraHD/Forma
Quote:
Originally Posted by BetterRed View Post
Sure but it won't be extensive testing, we've outsourced most of this sort of stuff to a Unity development shop.
I only asked because you expressed an interest in having such a thing. If you'd rather not, that's OK.

Quote:
Originally Posted by BetterRed View Post
Why not a Conversion (format-shifting) plugin, then in the longer term you could consider per book settings.
That one's easy to answer. I'm afraid I know nothing about Conversion plugins and I'm not really interested in spending the necessary time to become proficient. I can do all I need to do for my own purposes with User Interface and Editor plugins.
jackie_w is offline   Reply With Quote
Old 05-18-2018, 10:43 PM   #13
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 11,284
Karma: 10572868
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jackie_w View Post
I only asked because you expressed an interest in having such a thing. If you'd rather not, that's OK.
At the moment I open the epub with balabolka via calibre's Open With tool and get it to save the MP3 into the book folder with the same file name as the epub.

First time I have to drop the MP3 into calibre's book details panel to get to its existence recorded in calibre's database; a conversion plugin would obviate the need for that step. It's no big deal, if I open an RTF in Word and save as DOCX and/or PDF I have to do the same thing, same for video format shifting.

Quote:
Originally Posted by jackie_w View Post
That one's easy to answer. I'm afraid I know nothing about Conversion plugins and I'm not really interested in spending the necessary time to become proficient. I can do all I need to do for my own purposes with User Interface and Editor plugins.
Understood.

BR
BetterRed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] HTMLgen Output Plugin PeTrDu Plugins 30 07-03-2018 02:26 AM
How to install "incompatible" apps to Boox M96+T68. IVONA TTS, ACAPELA TTS etc. Booxtor Onyx Boox 24 04-19-2017 06:08 AM
Problem with TTS on OnyxBoox M92 "invalid TTS data" Marion Juin Onyx Boox 1 03-27-2013 06:56 PM
GUI Launcher greyed out when TTS is on and does not come back when TTS is off jmseight Kindle Developer's Corner 4 07-28-2012 03:48 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 03:24 AM


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


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