Kodi Community Forum
Release Kodi Screen Reader (Text to speech) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152)
+---- Thread: Release Kodi Screen Reader (Text to speech) (/showthread.php?tid=196757)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


RE: Kodi Screen Reader (Text to speech) - donkamillo - 2015-12-15

OK, pulseaudio didn't work. Speech was repeating like echoes, responces were extremely slow. So I uninstalled pulseaudio, wich left me with a broken installation.

But that is what I really like about the pi: Just re-flash the card, install the 1 or 2 extra packages, copy the .kodi-directory back into the home directory, voila! :-) It's nice to have backups! :-)

OK, for now I will live with the missing parts of the text, but I'll keep experementing. Maybe I find something that works.

Regards!


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-22

Hello folks,

I'm trying to package Kodi Screen Reader for the OSMC distribution. Thing I eventually would like to accomplish is to have this addon integrated by default into OSMC, so that it is possible to have speech in every OSMC installation with a single key stroke, like on the Mac. Only problem I'm facing is that Kodi Screen Reader starts by default when it's put into the addons folder. Is there a way to change the addon in a way that it doesn't start by default, while not having to tweak the addon database or the addon settings in userdata?


RE: Kodi Screen Reader (Text to speech) - Traker1001 - 2015-12-22

That would be awesome. I think the Addon being enabled or disabled by default is a function that is central to kodi itself and not the Addon itself. So you might get a better answer to this question by posing it in the Development forum.

donkamillo
My experience with Pulse was not the same as yours, It actually worked pretty well for me, to the point it was pretty usable. However, When I tried it, It was on the Pi1 so something may have changed. I have a New Pi sitting here, as was planning to get into testing it again myself, I just have to get to it.


RE: Kodi Screen Reader (Text to speech) - Traker1001 - 2015-12-22

On thing I thought of though, Is you want the addon to start the first time at least to load the keyboard layout. So maybe it would be possible to create a script to init the addon, load the KB lay out and then disable itself.


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-23

That sounds good. If someone could assist in getting such a thing in operation, that'd be great. I have some Python knowledge but currently not that into Kodi Addon coding yet.


RE: Kodi Screen Reader (Text to speech) - Traker1001 - 2015-12-23

Unfortunately I don't know enough about coding to do such a thing, Otherwise I'd help out. And I think Ruuk is pretty busy with other projects at the moment. So I am not entirely sure who'd be able to do so. Maybe someone on the development forum, Or the OSMC forum might even be a better bet.


RE: Kodi Screen Reader (Text to speech) - ruuk - 2015-12-24

One thing I could do is create a check in the addon for the existence of another addon. For example, I could make it so that if the addon service.xbmc.tts.pre is installed, the screen reader will disable itself on first run. The service.xbmc.tts.pre would basically be a dummy addon - you would include it with with the normal addon when pre-installing just for this purpose. This is first thought for something both simple for me to implement in code and simple for the packager to implement.


RE: Kodi Screen Reader (Text to speech) - ruuk - 2015-12-24

Hmm. A possible problem with that would be that it depended on the dummy addon to be 'ready' first which might be an issue. I'm not really sure off the top of my head how Kodi initially loads included addons. Might be better to just have it check for the existence of the dummy addon's directory in this case.

Guess I'm thinking out loud here Smile


RE: Kodi Screen Reader (Text to speech) - Darien - 2015-12-28

I just upgraded OSMC today and the Screen reader is not speaking anymore Sad I wonder if it's a new patch to OSMC that is doing this?


RE: Kodi Screen Reader (Text to speech) - Darien - 2015-12-28

update on OSMC and screen reader:
In the new updated OSMC (2015-11-29 image) if you Change 'Play Speech Directly Via eSpeak' to Yes, the screenreader won't speak anymore. I don't know if this is a new issue to OSMC, to kodi to debian or what. I reinstalled and tried again, same result.


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-30

@ruuk: it might be enough to check whether an OSMC specific module, such as script.module.osmccommon or service.osmc.settings is running? That feels a bit cleaner than creating a dummy addon just for this purpose. Only drawback that would create is that on a new OSMC install, everyone always has to manually enable the screen reader with the hotkey. I will experiment with the dummy addon approach regarding the question whether it is auto activated by Kodi and will report on that later today.


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-30

(2015-12-28, 12:16)Darien Wrote: update on OSMC and screen reader:
In the new updated OSMC (2015-11-29 image) if you Change 'Play Speech Directly Via eSpeak' to Yes, the screenreader won't speak anymore. I don't know if this is a new issue to OSMC, to kodi to debian or what. I reinstalled and tried again, same result.

Is there any reason you want 'Play Speech Directly Via eSpeak'? The OSMC update doesn't contain anything specific to espeak. Have you tried the recent december build as well?


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-30

Have created a service.xbmc.tts.pre addon which succesfully loads when in /usr/share/kodi/addons. Also tried putting service.xbmc.tts in /usr/share/kodi/addons, but observed the following. It seems that the addon sounds don't play and the keymap doesn't load correctly. Now, util.py contains:

def playSound(name,return_duration=False):
wavPath = os.path.join(xbmc.translatePath('special://home'),'addons','service.xbmc.tts','resources','wavs','{0}.wav'.format(name))
#wavPath = os.path.join(xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path')).decode('utf-8'),'resources','wavs','{0}.wav'.format(name))
xbmc.playSFX(wavPath)

I wonder whether the second wavPath is commented out? This way, playing of sounds is hard coded to the addon in the home directory, which shouldn't be the case I think.


RE: Kodi Screen Reader (Text to speech) - ruuk - 2015-12-30

(2015-12-30, 12:41)leonardder Wrote: Have created a service.xbmc.tts.pre addon which succesfully loads when in /usr/share/kodi/addons. Also tried putting service.xbmc.tts in /usr/share/kodi/addons, but observed the following. It seems that the addon sounds don't play and the keymap doesn't load correctly. Now, util.py contains:

def playSound(name,return_duration=False):
wavPath = os.path.join(xbmc.translatePath('special://home'),'addons','service.xbmc.tts','resources','wavs','{0}.wav'.format(name))
#wavPath = os.path.join(xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path')).decode('utf-8'),'resources','wavs','{0}.wav'.format(name))
xbmc.playSFX(wavPath)

I wonder whether the second wavPath is commented out? This way, playing of sounds is hard coded to the addon in the home directory, which shouldn't be the case I think.

I don't remember precisely why at the moment, but for whatever reason this method can be called when the add-on is disabled, which is why the commented out method doesn't work. I should probably have a comment here explaining this. To make this work when the add-on is pre-installed, I'll probably need to verify the path exists and if not check with the system add-ons because unfortunately (iirc) getAddonInfo() doesn't work unless the add-on is enabled.


RE: Kodi Screen Reader (Text to speech) - leonardder - 2015-12-30

Sounds fine to me.

For OSMC users, i created a fork of the osmc repository at https://github.com/leonardder/osmc.git, which contains the screenreader branch. That branch contains the mediacenter-screenreader-osmc package, which contains both service.xbmc.tts and service.xbmc.tts.pre.