Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-20-2020, 11:53 PM   #31
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@Kovid,
Just so you get a notification that I've updated the win32 import list and posted an updated zip in post #29.
jackie_w is offline   Reply With Quote
Old 10-21-2020, 02:04 AM   #32
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I looked into it briefly and replacing all of tts_typelib and the various COM wrappers is too much work. However, from looking at the actual plugin code, what your plugin needs seems to be:

1) Get list of available voice names
2) Get list of available audio output names
3) Play specified text with a given voice name and audio output name at s specified volume and rate
4) Pause/resume playback
5) Same as 3 but record it to a file


Creating a wrapper that does these is not too bad. Please confirm this is all that's needed.
kovidgoyal is offline   Reply With Quote
Advert
Old 10-21-2020, 05:52 AM   #33
Doitsu
Grand Sorcerer
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: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kovidgoyal View Post
Creating a wrapper that does these is not too bad.
There already is a lightweight python TTS wrapper by Joshua Milas that I used for my simple Sigil TTS plugin.

Maybe you could add the wrapper to Calibre? (The wrapper is MIT-licensed and consists of only two very small files.)
Doitsu is offline   Reply With Quote
Old 10-21-2020, 06:22 AM   #34
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, that's a pure python library, so it, alongwith its dependency comtypes could just be bundled in the plugin.
kovidgoyal is offline   Reply With Quote
Old 10-21-2020, 09:24 AM   #35
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Doitsu View Post
There already is a lightweight python TTS wrapper by Joshua Milas that I used for my simple Sigil TTS plugin.

Maybe you could add the wrapper to Calibre? (The wrapper is MIT-licensed and consists of only two very small files.)
Quote:
Originally Posted by kovidgoyal View Post
Yes, that's a pure python library, so it, alongwith its dependency comtypes could just be bundled in the plugin.
I'll take another look at this option. IIRC, this was Python3-only so was a non-starter, at the time, for a calibre plugin.

@Kovid, How long do I have to get this working before the win32 stuff is removed from calibre?
jackie_w is offline   Reply With Quote
Advert
Old 10-21-2020, 11:34 AM   #36
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
The good news is that I should be able to use Doitsu's TTS replacement to do the speaking and recording to WAV.

The bad news is that I'm missing some basic understanding of how to include the comtypes module in the plugin.

Doitsu's Sigil plugin includes a comtypes directory. I've done the same in the calibre plugin by taking a copy of the comtypes directory from my local Python3.5 site-packages.

What do I need to do to point the plugin at it's own bundled comtypes rather than looking for it in calibre's python? I tried adding
Code:
from calibre_plugins.tts_to_mp3_plugin import comtypes
at the top of comtypes/__init__.py, but that doesn't appear to be correct.
jackie_w is offline   Reply With Quote
Old 10-21-2020, 01:12 PM   #37
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The simplest way to do that is to simply have the comtypes package stored in its own zip file inside the plugin zipfile. Then extract that zipfile into a temporary file somewhere and do

sys.path.append('path/to/extracted/zip/file')

now you should be able to import and use comtypes.
kovidgoyal is offline   Reply With Quote
Old 10-21-2020, 01:12 PM   #38
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by jackie_w View Post
@Kovid, How long do I have to get this working before the win32 stuff is removed from calibre?
The next release is dropping pywin32 so at a minimum friday but more likely next friday.
kovidgoyal is offline   Reply With Quote
Old 10-21-2020, 02:07 PM   #39
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kovidgoyal View Post
The simplest way to do that is to simply have the comtypes package stored in its own zip file inside the plugin zipfile. Then extract that zipfile into a temporary file somewhere and do

sys.path.append('path/to/extracted/zip/file')

now you should be able to import and use comtypes.
Are you saying that if this is done then simple import statements such as
Code:
import comtypes
import comtypes.client
will no longer fail?

Does that leave crud in the user's main Windows environment variable PATH? That would be a bit intrusive, wouldn't it?
jackie_w is offline   Reply With Quote
Old 10-21-2020, 11:37 PM   #40
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes, and you put it in a temp directory not PATH.
kovidgoyal is offline   Reply With Quote
Old 10-22-2020, 03:12 AM   #41
2018robert
Junior Member
2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals2018robert is kind to children and small, furry animals
 
Posts: 2
Karma: 6624
Join Date: Dec 2018
Device: kindle
This is a good plugin when working, unfortunately it's not working for me. I'm using calibre 5.3

Here's the error dump, don't know if it's any use.

Thanks for having a go!


calibre, version 5.3.0
ERROR: Unhandled exception: <b>com_error</b>-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147200966), None)

calibre 5.3 embedded-python: True is64bit: False
Windows-10-10.0.19041-SP0 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: TTS to MP3 (0, 4, 0)
Traceback (most recent call last):
File "calibre_plugins.tts_to_mp3_plugin.uiaction", line 175, in show_dialog
File "calibre_plugins.tts_to_mp3_plugin.tts_to_mp3" , line 211, in __init__
File "calibre_plugins.tts_to_mp3_plugin.tts_to_mp3" , line 234, in initialise_data
File "calibre_plugins.tts_to_mp3_plugin.other_dlgs" , line 377, in get_voices_all
File "calibre_plugins.tts_to_mp3_plugin.tts_typelib ", line 1760, in GetDescription
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147200966), None)
2018robert is offline   Reply With Quote
Old 10-22-2020, 08:37 AM   #42
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
duplicate post deleted

Last edited by jackie_w; 10-22-2020 at 08:43 AM. Reason: duplicate post
jackie_w is offline   Reply With Quote
Old 10-22-2020, 08:42 AM   #43
jackie_w
Grand Sorcerer
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: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by 2018robert View Post
This is a good plugin when working, unfortunately it's not working for me. I'm using calibre 5.3

Here's the error dump, don't know if it's any use.

Thanks for having a go!
This error reminds me of a problem encountered when the plugin was first released when running calibre 32-bit. I thought I'd worked around that long ago.

The current version of the plugin (v4.0) is working for me on Windows 10 in all of these variations:
- calibre 5.2 64-bit
- calibre 4.23 32-bit (on my 64-bit PC)
- calibre portable v5.3, which uses the 32-bit version of calibre, which I think should replicate what your error log suggests you're using, i.e. 32-bit calibre on a 64-bit PC.

If you've been able to pick up the gist of the posts in this thread from the last couple of days you'll see that Kovid has warned that this plugin will cease functioning altogether with the next release (5.4) of calibre because some of the underlying calibre Windows modules, necessary for this plugin, have been removed.

I'm currently trying hard to see whether the plugin can be made to work without those old Windows modules. 24 hours ago I was hopeful something could be salvaged but after a fruitless day yesterday I'm no longer sure. Nevertheless, I'm not ready to throw in the towel just yet.

I can't follow up your problem in more detail, at the moment. Because of the above I need to keep my own non-portable versions of calibre installations as-is for a few days to keep trying to stop the plugin dying altogether.

I will try to give you a better answer when I have more time but, in the meantime, if you're able, perhaps you could try one of the calibre installations which I've stated above are currently working for me. Is there a reason you're using the 32-bit version of calibre on your 64-bit PC?
Code:
calibre 5.3 embedded-python: True is64bit: False
Windows-10-10.0.19041-SP0 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: TTS to MP3 (0, 4, 0)
jackie_w is offline   Reply With Quote
Old 10-22-2020, 11:57 AM   #44
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@jackie_w: FYI I have added wrappers for all functions i described earlier to calibre, so you dont need to depend on any external libraries. In fact I have even added code to directly output mp3 files, so you can drop lame.exe as well.

You can see how to use it by reading the tests in this file: https://github.com/kovidgoyal/calibr...ows/winsapi.py

It was surprisingly easy, only about 500 lines of code.
kovidgoyal is offline   Reply With Quote
Old 10-22-2020, 12:15 PM   #45
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: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Oops I spoke to soon, mp3 output doesnt work, but wav output does.
kovidgoyal is offline   Reply With Quote
Reply

Tags
calibre, mp3, neural, tts, voices


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] TTS - Windows TTS output plugin Doitsu Plugins 12 05-18-2018 10:43 PM
How to install "incompatible" apps to Boox M96+T68. IVONA TTS, ACAPELA TTS etc. Booxtor Onyx Boox 24 04-19-2017 06:08 AM
which one you will prefer an audiobook or tts webroot Audiobook Discussions 4 08-06-2015 04:40 PM
E-ink device with TTS/audiobook integration verona Which one should I buy? 21 05-15-2013 07: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 03:48 AM


All times are GMT -4. The time now is 07:18 AM.


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