It is currently Sat May 26, 2018 5:30 pm

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Utility request
PostPosted: Fri Apr 02, 2010 11:57 am 
Offline

Joined: Thu Feb 18, 2010 8:04 pm
Posts: 118
Location: Czech Republic
My eyes are really weak and get easily tired after a longer chat in cavern. I'd like to ask for an utility which could route chat area text into a text-to-speech (TTS) engine, so that I have chat messages spoken aloud.

Implementation suggestions:

* The easiest way is to monitor chatlog.0.txt for new contents and routing that new contents into a speech ingine.

* Time stamp at the beginning of all the log lines should be stripped off before speaking

* Messages should be queued, so that they get all spoken completely even if the new one comes before the previous one(s) are processed by TTS

* A scripting tool is good enough to implement this, I think

If anyone is willing to help improving MO:ULa experience for a weak-sighted user, it would be really appreciated.

Thans for your help in advance.

_________________
KI#: 02331712


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 03, 2010 6:17 pm 
Offline
Obduction Backer

Joined: Mon May 15, 2006 2:02 pm
Posts: 809
Location: Switzerland
If you happen to be on Mac OS X, try running this in Terminal (with the location of your chat log file substituted):

Code:
tail -F ~/Library/Preferences/MOULagain\ Preferences/p_drive/My\ Documents/Uru\ Live/Log/Chat.0.log | sed -l s/\'/\\\\\'/g | sed -l "s/^(..\/.. ..:..:..) //" | xargs -I % osascript -e 'say "%"'


It appears to work fine in my limited testing, although it probably doesn’t cope with wild combinations of backslashes, quotation marks, and apostrophes – that’s where shell scripting starts to get messy.

(This is just a quick hack to see if it can be done. If anyone is serious about using this, I can be of more assistance.)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 3:55 am 
Offline

Joined: Thu Feb 18, 2010 8:04 pm
Posts: 118
Location: Czech Republic
thanks for you reply. I'm on Windows, but I think there's a way I can use your one-liner there too, it's just behind my skills to adapt it :-)

_________________
KI#: 02331712


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 8:40 am 
Offline
Obduction Backer

Joined: Mon May 15, 2006 2:02 pm
Posts: 809
Location: Switzerland
I doubt it – getting a Unix shell is easy enough with Cygwin, but you’d probably have trouble finding an AppleScript interpreter.

Although, silly me, there is no need to add AppleScript into the mix, since there’s a /usr/bin/say command (I had only looked for “speak”) – so here is version 2:
Code:
tail -F ~/Library/Preferences/MOULagain\ Preferences/p_drive/My\ Documents/Uru\ Live/Log/Chat.0.log | sed -l "s/^(..\/.. ..:..:..) //" | sed -l "s/\(['\"\\]\)/\\\\\1/g" | xargs -I % say %


If you can find something like “say” for the Windows text-to-speech, that might work with Cygwin.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 8:48 am 
Offline

Joined: Wed Nov 08, 2006 5:45 pm
Posts: 2553
I can create this for Windows in C#, though I won't be able to start on it until after next week.

_________________
Nothing to see here, move along.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 12:04 pm 
Offline

Joined: Thu Feb 18, 2010 8:04 pm
Posts: 118
Location: Czech Republic
Thanks for your interest. That one-liner is great - for one-shot speech. But I need speech to go on continuously, and then there's an issue with retrieving just NEW contents - "tail" just might be not enough, although I don't understand all its parameters.

Any help's appreciated, I don't mind waiting.

_________________
KI#: 02331712


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 3:01 pm 
Offline
Obduction Backer

Joined: Mon May 15, 2006 2:02 pm
Posts: 809
Location: Switzerland
It’s not just for one-shot speech. My one-liner meets all your stated requirements (except working on Windows). Monitoring a file for newly added lines is what “tail -F” does.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 04, 2010 3:31 pm 
Offline

Joined: Thu Feb 18, 2010 8:04 pm
Posts: 118
Location: Czech Republic
Thanks, Christian. tail and sed are part of cygwin, so that's no problem. The only remaining part is the speech output using SAPI5 voice in Windows. Cygwin features eSpeak, but it's horrible to listen to for an extended period of time.

_________________
KI#: 02331712


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 05, 2010 7:39 am 
Offline

Joined: Thu Feb 18, 2010 8:04 pm
Posts: 118
Location: Czech Republic
There are some nice Javascript snippets at http://jimlawless.wordpress.com/2009/11/30/windows-text-to-speech-in-wsh-javascript/. Could someone adapt them to work with Cristian's one-liner? I don't seem to have enough skill :-(

EDIT: And maybe GNU Utilities for Win32 (http://gnuwin32.sourceforge.net/) are the best bet for me to get things running as expected

_________________
KI#: 02331712


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: