This forum is locked: you cannot post, reply to, or edit topics. This topic is locked: you cannot edit posts or make replies.

Page 1 of 1

Topic

TomVal

Joined: 18 Feb 2010

Posts: 118

Location: Czech Republic

Reply with quote

Post Posted: Fri Apr 02, 2010 11:57 am — Post subject: Utility request

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

Christian Walther

Joined: 15 May 2006

Posts: 668

Location: Switzerland

Reply with quote

Post Posted: Sat Apr 03, 2010 6:17 pm — Post subject:

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.)

TomVal

Joined: 18 Feb 2010

Posts: 118

Location: Czech Republic

Reply with quote

Post Posted: Sun Apr 04, 2010 3:55 am — Post subject:

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

Christian Walther

Joined: 15 May 2006

Posts: 668

Location: Switzerland

Reply with quote

Post Posted: Sun Apr 04, 2010 8:40 am — Post subject:

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.

Herohtar

Joined: 08 Nov 2006

Posts: 2551

Reply with quote

Post Posted: Sun Apr 04, 2010 8:48 am — Post subject:

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.

TomVal

Joined: 18 Feb 2010

Posts: 118

Location: Czech Republic

Reply with quote

Post Posted: Sun Apr 04, 2010 12:04 pm — Post subject:

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

Christian Walther

Joined: 15 May 2006

Posts: 668

Location: Switzerland

Reply with quote

Post Posted: Sun Apr 04, 2010 3:01 pm — Post subject:

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.

TomVal

Joined: 18 Feb 2010

Posts: 118

Location: Czech Republic

Reply with quote

Post Posted: Sun Apr 04, 2010 3:31 pm — Post subject:

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

TomVal

Joined: 18 Feb 2010

Posts: 118

Location: Czech Republic

Reply with quote

Post Posted: Mon Apr 05, 2010 7:39 am — Post subject:

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

All times are GMT

Jump to:

This forum is locked: you cannot post, reply to, or edit topics. This topic is locked: you cannot edit posts or make replies.

Page 1 of 1

You can…

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
You cannot vote in polls in this forum