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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-17-2018, 10:26 AM   #1
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,487
Karma: 10971447
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, Kobo AuraHD/Aura6"/H2O/GloHD/KA1/ClaraHD
[GUI Plugin] TTS to MP3: Create MP3 audiobook using Windows TTS

Purpose: This plugin can record a set of audiobook MP3 files for a non-DRM ebook in your calibre library. For most retail fiction ebooks this is likely to equate to one MP3 per chapter. The selected book needs to be available in EPUB, AZW3 or KEPUB format.
N.B:
The plugin uses Microsoft's built-in SAPI5 Text-to-Speech (TTS) software and Voices, therefore only available for Windows users. *** Unfortunately, it appears that it will only run on Windows/calibre 64bit ***

Pros: Free. Can be played on any MP3 player. No waiting for a publisher to decide if/when an audiobook will be available.
Cons: Obviously, automated TTS is not as good as a reading by a good professional voice artiste.

Background: The original idea came from Doitsu's Sigil plugin, Windows TTS output. This was a fun project for me which provided a personal challenge to create a plugin which can run in the background. I'm sharing it here with Doitsu's permission.

Features: See first attached screenshot for main GUI screen.
  • Allows you to select which of the ebook's content files you want to create MP3s from. Useful if you don't want an MP3 for front- and backmatter pages.
  • The file selection GUI (see second attached screenshot) also contains a Voice Tester feature so you can easily try out the various voices installed on your PC. You can use text from your selected book or copy/paste your own sample text for the Voice Tester.
  • Uses metadata from the book and calibre library for the MP3 tags and filenames. Some user choice provided.

How to install: The plugin is not yet part of the official calibre Index of Plugins. So for now:
  • Download attached .zip file to your PC.
  • Open calibre Preferences > Change calibre behavior > Plugins > Load plugin from file and double-click on the downloaded .zip
  • Follow on-screen instructions.
  • Finish off by re-starting calibre

How to use:
Spoiler:
  • Select a single non-DRM'd book in calibre (EPUB, AZW3 or KEPUB)
  • Select TTS to MP3 from whichever calibre toolbar/menu you added it to.
  • See first screenshot. Select the files to be recorded using either the [All] or [Manual Select] button. The latter will open a new dialog (see second screenshot) showing a list of available files with their wordcount and TOC title (if any). You can see the whole text content of any file by clicking it. Alternatively, you can see a tooltip preview of the beginning of any file by hovering the mouse over its HTML filename.
  • Play with the Voice Tester if required, then [Save] the list of files to be recorded to MP3. If you changed the Voice Name and/or Rate, they will also be transferred to the main screen.
  • Adjust the MP3 tag options for Artist/Album/Genre/Year if required. Each tag box is editable so, if you don't like any of the options on offer, just type your own value.
  • Click the [Create MP3s] button and choose a destination directory for the new MP3s.
  • The MP3s will be created as a background task leaving you free to get on with other things. You can check ongoing progress by clicking the [Jobs:n] button in the bottom-right corner of the calibre window. When all MP3s are complete you will see a standard calibre notification pop-up appear in the bottom-right corner.

Configuration: See third attached screenshot.
Spoiler:
  • Default Voice & Speech rate: Hopefully self-explanatory. See post #2 below for more details about Voices.
  • Cover thumbnail: Embed a small cover thumbnail in every MP3 or copy thumbnail once to selected MP3 directory (as cover.jpg). Use if disk space is an issue.
  • Image alternate text (experimental): Some publishers provide a description of each image in each <img alt="Helpful description here".../>. If this alt-text exists you can choose to have the contents read aloud or not.

    I've included this experimental feature following discussion in this recent thread where it became clear that all of the popular Android TTS-enabled reading apps tested completely ignore this descriptive text.
    Caveat: Some publisher-provided alt-text descriptions are not at all helpful to users. You will need to decide whether to enable this on a book-by-book basis.


Testing: All testing was done on a Windows 10 x64 PC running calibre x64 and using voices of various dialects of English. The plugin may work on Windows 8 but I'm not sure.

Credits: Thanks to Doitsu for the original Sigil work and for beta-testing. Thanks to chye who didn't hang around MobileRead for long but did create a TTS plugin for the calibre Viewer. This code was very helpful. Thanks, as always, to kovidgoyal for fast help with technical issues. The plugin uses LAME for generating MP3 files.

Version History:
Spoiler:
  • Version 0.1.1: 18 June 2018
    Will not currently run on 32-bit Windows/calibre. This includes calibre Portable. On 32-bit, this version will fail in a slightly more graceful way.
  • Version 0.1.0: 17 June 2018 - Initial release
Attached Thumbnails
Click image for larger version

Name:	main.jpg
Views:	131
Size:	78.0 KB
ID:	164499   Click image for larger version

Name:	select_files.jpg
Views:	156
Size:	153.3 KB
ID:	164500   Click image for larger version

Name:	config.jpg
Views:	105
Size:	57.5 KB
ID:	164501  
Attached Files
File Type: zip TTS to MP3_v0-1-1.zip (446.7 KB, 66 views)

Last edited by jackie_w; 06-18-2018 at 08:55 AM. Reason: Will not run on calibre 32bit. Version 0.1.1 released
jackie_w is offline   Reply With Quote
Old 06-17-2018, 10:27 AM   #2
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,487
Karma: 10971447
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, Kobo AuraHD/Aura6"/H2O/GloHD/KA1/ClaraHD
More about TTS Voices

I'm aware that this post is a bit of an infodump. It will be improved if/when better info becomes available.

Windows users can install additional Microsoft Speech Platform voices. For details see this website. For my testing I was able to install all these English/dialect voices quite easily using standard Windows settings options:

Voices marked with * are Cortana Speech Assistant voices.
English - GB: Hazel, Susan, George, Sarah*
English - US: Zira, David, Mark, Eva*
English - Canada: Linda, Richard, Eva*
English - Australia: Catherine, James, Matilda*
English - India: Heera, Ravi, Koyal*
English - Ireland: Sean
N.B. Cortana Eva (US) and Cortana Eva (Canada) are stored as separate files so don't assume they are the same thing.

The installed voice files are stored in
C:\Windows\Speech_OneCore\Engines\TTS\

Each language/dialect has its own sub-directory e.g. English US voices are stored in
C:\Windows\Speech_OneCore\Engines\TTS\en-US\

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now comes the tricky part. Just because you installed some voices doesn't mean this plugin (or the Sigil one) can automatically see them. Unfortunately, solving this problem requires editing your Windows Registry.
*** This is most definitely not something you should undertake lightly ***

There is a tutorial here which tells you how to enable the English US voices Mark and Eva. Windows Registry (.reg) update files are provided. Before you run them you should make sure that your directory C:\Windows\Speech_OneCore\Engines\TTS\en-US actually contains files for Mark and Eva (see first attached screenshot)

Using the Eva/Mark .reg files and a bit of Sherlock-ian extrapolation I was able to create similar .reg files to enable all the voices listed above for this plugin and the Sigil one. ** See end of post.

On my Windows 10 x64 PC running calibre x64, for any voice to appear in this plugin's voice list it needs to be added under this key (see second screenshot):
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens]
Windows/calibre 32-bit: Plugin will not currently run on 32-bit.
What I'm not clear about is whether a PC running either Windows 32bit and/or calibre 32bit needs the voices to be added under this key instead (see third screenshot):
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\SPEECH\Voices\Tokens]

Any illuminating contributions for this post most gratefully received

** For anyone who is comfortable with Windows Registry editing and its potential risks I'm happy to share all the .reg files I created. You need to PM me as I'm not happy posting them in public without a lot more testing by others.
Attached Thumbnails
Click image for larger version

Name:	win_voice_files.jpg
Views:	85
Size:	157.3 KB
ID:	164504   Click image for larger version

Name:	win64.jpg
Views:	80
Size:	132.4 KB
ID:	164505   Click image for larger version

Name:	win32.jpg
Views:	85
Size:	150.6 KB
ID:	164506  

Last edited by jackie_w; 06-18-2018 at 10:29 AM. Reason: Plugin won't currently run on Windows/calibre 32-bit
jackie_w is offline   Reply With Quote
Old 06-18-2018, 12:39 AM   #3
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,655
Karma: 13662888
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Looking forward to experimenting with this. Thanks.
DoctorOhh is offline   Reply With Quote
Old 06-18-2018, 08:59 AM   #4
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,487
Karma: 10971447
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, Kobo AuraHD/Aura6"/H2O/GloHD/KA1/ClaraHD
Quote:
Originally Posted by DoctorOhh View Post
Looking forward to experimenting with this. Thanks.
You're welcome Probably a very niche requirement in these days of Audible subscriptions and smart phones, but always good to have options.
jackie_w is offline   Reply With Quote
Old 06-18-2018, 09:06 AM   #5
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,487
Karma: 10971447
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, Kobo AuraHD/Aura6"/H2O/GloHD/KA1/ClaraHD
update v0.1.1

Sigh ... unfortunately it appears that some of the Microsoft Speech interface will only run on 64-bit Windows/calibre. This will exclude the plugin from running on calibre Portable.

This update will fail in a slightly more graceful way if a 32-bit user tries to use it.

At the moment I don't have any realistic hope that I'll be able to work around this limitation.
jackie_w 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] TTS - Windows TTS output plugin Doitsu Plugins 12 05-18-2018 09:43 PM
How to install "incompatible" apps to Boox M96+T68. IVONA TTS, ACAPELA TTS etc. Booxtor Onyx Boox 24 04-19-2017 05:08 AM
which one you will prefer an audiobook or tts webroot Audiobook Discussions 4 08-06-2015 03:40 PM
E-ink device with TTS/audiobook integration verona Which one should I buy? 21 05-15-2013 06:11 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 02:48 AM


All times are GMT -4. The time now is 05:43 PM.


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