Release Kodi Screen Reader (Text to speech)
Ok so I got my Wetek Play and it is a pretty neat box. The default Android image is exactly what you would expect but uses the app store version of Kodi which is 14.2 atm. So I decided to go with Openelec as they are officially endorsed by Wetek and wetek even roll there own version. I opted for the Openelec official build from there site instead.


However out of the box the TTS plugin will not work with Google backend because, as Ruuk mentioned, it requires a mp3 player such as mpg123, or mpg321. Conversely though espeak plugin worked out of the box. Go espeak! Smile

Openelec does not come with mpg321 by default so I unpacked the system image and added the mpg321 binaries form Debian armhf arch as it just needs a few support libs like libao4, libao-common, libid3tag0, libmad0 and zlib1g which were easy enough to include. You move all the libs from the arch path to /usr/lib in the case of openelec.

Ok so all going swimmingly I tested mpg321 from the command line on some normal mp3s they worked fine. But still no sound from the screen reader. Hmm ok so something else is going on. Turns out OpenElec/Kodi 15 defaults to holding the audio interface open for a minute which combined with UI sounds which is also default meant the audio device was being locked. Why that happens with Google and not epeak is because Google uses mp3 -> wav -> aplay where as espeak can tap into aplay directly. So turn both those off and hey I have speech ... only this is the weird part speech at 8 times the speed? Well maybe not 8 times but super fast anyway. For some reason the Google mp3 when played with mpg321 on armhf plays super fast. But I discovered that if I pass --stereo param it speaks normal. Ok so I spent the next hour chewing through the add on I found what I was looking for in lib/backends/audio/__init__.py


--- CUT ---

371,372c371,372
< _playArgs = ('mpg321','-q',None)
< _pipeArgs = ('mpg321','-q','-')
---
> _playArgs = ('mpg321','-q','--stereo',None)
> _pipeArgs = ('mpg321','-q','--stereo','-')

-- CUT --

And hey presto.. voices now work at normal speed! Would be lovely to be able to slow it down a touch but I suspect I would need to make some new options for the google backend.


There was something that did flag in the log though which might be more generic.

--- CUT ---
WARNING: CPythonInvoker(0, /storage/.kodi/addons/service.xbmc.tts/main.py): the python script "/storage/.kodi/addons/service.xbmc.tts/main.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon7xbmcgui6WindowE,N14PythonBindings31XBMCAddon_xbmc_Monitor_DirectorE
-- CUT --

For the record the python installed on openelec is Python 2.7.3

Now is use it works pretty much as expected and is pretty sweet for your general navigation and information windows. Personal things I have noticed which is a limitation for Google is it will describe punctuation like underscored and hyphens if they are not part of a word. So I had to change file names to ones with spaces.

But the problem I have noticed. Sometimes, more often than not, when starting streaming videos the dialog will continue on into the start of the playing video even announcing "Window: Video Full screen" which stops the video audio from playing. If you muck about enabling and disabling audio pass-through while the video is playing the audio will come back. I am guessing this is because as the audio is being passed to another program there is no way to halt it (short of killing the process) when a video starts and so it conflicts and locks the audio device. I looked into the poll interview parameter but I am not sure how or what that actually is.

I need to point out here that the WePlay openelec build uses Alsa and not pulseaudio so does not play well with multiple sound sources. Bummer.

So my question is, is there way to ignore certain messages from the window UI. Specifically when playing streaming videos. They just seem a little superflous as we don't really need to know the video is playing if we can hear it's own audio start up first.

Once again thank you so much ruuk for your efforts in building this plugin it really is very sweet to configure and use.

Cheers,


EDIT:

Ok something more to add. I tested it with espeak and it seem espeak and the video audio will play concurrently meaning when the voice has stopped speaking the video audio continues as normal. The same dialog is spoken "Window: Full screen Video" but it does not lock the device.. Hmm

I need to look into the addon a little more but can we assume aplay is the key here and that by using that it does not lock the audio device away from the video audio? The problem is converting mp3->wav->aplay without locking the audio device. I am going to have a look at mplayer and see if that works better.

EDIT 2:

A thought occurs to me. In the System settings - Audio section. It lists the GUI sounds options as being NEVER, ONLY WHEN PLAYBACK IS STOPPED, and ALWAYS. Can we have a similar option in Kodi Screen Reader where it will disable on video playback and hopefully will not over ride the audio of the video playing?

I'll investigate this myself but I don't know the code as well as others so I am guessing it will take me a lot longer.

Thanks.
Reply


Messages In This Thread
Kodi Screen Reader (Text to speech) - by ruuk - 2014-06-02, 00:15
v0.0.67 - by ruuk - 2014-06-02, 22:37
v0.0.68 - by ruuk - 2014-06-03, 23:14
v0.0.69 - by ruuk - 2014-06-05, 18:38
v0.0.70 - by ruuk - 2014-06-08, 02:30
v0.0.71 - by ruuk - 2014-06-09, 01:35
v0.0.72 - by ruuk - 2014-06-11, 02:06
v0.0.73 - by ruuk - 2014-06-12, 20:20
v0.0.75 - by ruuk - 2014-06-17, 02:16
v0.0.75 - by ruuk - 2014-06-18, 02:12
v0.0.76 - by ruuk - 2014-06-23, 01:37
v0.0.77 - by ruuk - 2014-06-30, 00:19
v0.0.78 - by ruuk - 2014-07-01, 20:50
v0.0.79 - by ruuk - 2014-07-06, 01:30
speech.server v0.0.7 - by ruuk - 2014-06-11, 22:54
v0.0.80 - by ruuk - 2014-07-06, 19:42
v0.0.81 - by ruuk - 2014-07-07, 19:35
v0.0.82 - by ruuk - 2014-07-11, 19:40
v0.0.83 - by ruuk - 2014-08-14, 00:31
v0.0.84 - by ruuk - 2014-10-26, 23:26
v0.0.85 - by ruuk - 2014-11-01, 21:54
v0.0.86 - by ruuk - 2014-12-16, 20:52
v0.0.87b - by ruuk - 2014-12-23, 01:09
v0.0.88b - by ruuk - 2014-12-23, 02:18
v0.1.0b - by ruuk - 2014-12-25, 21:12
v0.1.1b - by ruuk - 2014-12-26, 21:26
v0.1.2 - by ruuk - 2015-02-28, 02:12
v1.0.0 - by ruuk - 2015-04-06, 19:38
v1.0.1 - by ruuk - 2015-04-25, 19:14
v1.0.2 - by ruuk - 2015-06-28, 01:18
v1.0.3 - by ruuk - 2015-09-07, 23:09
v1.0.4 - by ruuk - 2015-10-02, 19:43
v1.0.5 - by ruuk - 2015-10-06, 20:53
v1.0.6 - by ruuk - 2016-05-15, 19:02
v1.0.7 - by ruuk - 2017-07-16, 08:09
v1.0.8 - by ruuk - 2017-11-12, 09:59
v1.0.6b1 - by ruuk - 2016-01-02, 22:20
v1.0.6b2 - by ruuk - 2016-01-25, 19:12
Downloads Page Fixed - by ruuk - 2014-12-22, 21:17
RE: Kodi Screen Reader (Text to speech) - by lookidok - 2015-06-22, 01:54
Kodi Screen Reader (Text to speech) - by ruuk - 2015-11-11, 21:00
Kodi Screen Reader (Text to speech) - by ruuk - 2017-07-14, 23:08
Kodi Screen Reader (Text to speech) - by ruuk - 2017-11-18, 18:41
Kodi Screen Reader (Text to speech) - by ruuk - 2017-11-18, 21:29
Logout Mark Read Team Forum Stats Members Help
Kodi Screen Reader (Text to speech)10