Thursday, September 28, 2006

Using Helix Player From Emacspeak

In the spirit of You can never have sufficiently many media players, I now have Helix Player working under Emacspeak i.e., I can now run Helix Player without having to start up X. This is useful because there are still media streams on the Web that sometimes fail with mplayer, and from the minimal testing I've done so far, Helix Player is successful in those cases.

What Is It?

HelixPlayer --- installable on modern Linux distributions as hxplay from package HelixPlayer is the community-supported version of RealPlayer 10. The well-distributed and documented client, hxplay is capable of playing a wide variety of audio and video formats over HTTP and RTSP/RTP, and specifically, can handle RealPlayer10 formats which includes support for 5.1 audio.

A lesser known set of tools available from Helix --- Helix DNA Client is a bare-bones UI-less player which can be used effectively at the shell. You can download pre-built binaries for your flavor of Linux (GCC3.2 or later vs GCC 2.95 based systems) note that these are nightly builds. You can also download a source zip archive. Note that all of these requires you to accept a End Users License Agreement (EULA) before being taken to the download link.

The links on the page above can be confusing; Here are pointers to the specific packages you need to grab if you want a player that has all of the functionality described above.

Binary
Sep 26, 2006 build for Linux GCC 3.2
Sources
Source archive from September 27, 2006

Using The Binary Distribution

Here is what I did you set up the binary distribution on my Ubuntu 6.0.6 (Dapper) machine

  • Unpacked binary package under /usr/lib.
  • Created a symlink /usr/lib/splay to point to the directory created by unpacking the binary package.
  • Created the following shell script /usr/bin/hsplay to launch the player:
    #!/bin/sh
    #Use Simple Helix Player:
    #
    SPLAY_LIB=/usr/lib/splay
    export HELIX_LIBS=$SPLAY_LIB
    exec /usr/bin/aoss $SPLAY_LIB/splay -iss -s "$@"
    
  • The above script assumes you have the alsa-oss package nstalled; you will need this to have Helix Player use ALSA --- something that is essential if you want to be able to use your sound card with other applications while playing media streams.

With this setup, you can launch one or more media streams (both local, as well as remote HTTP/RTSP/RTP streams) from a shell. This player successfully plays the BBC Radio4 LW stream, something mplayer fails to play on my Ubuntu box.

Tuesday, September 12, 2006

Emacspeak, Ubuntu And Software Dectalk

On the positive side with respect to software synthesis, the Software Dectalk does work out of the box on Ubuntu --- out of the box that is if you first install alsa-oss the ALSA->OSS compatibility layer. I've updated the Emacspeak speech server for Software Dectalk to use alsa-oss where available; performance is not as responsive as the Emacspeak Viavoice server using the native ALSA APIs, but it's a good backup option.

Monday, September 11, 2006

Emacspeak 24 On Ubuntu 6

I upgraded my home FC3 machine to Ubuntu 6.0.6 (Dapper) over the weekend. Here is a short summary for things to watch out for as an emacspeak user.

The Good, The Bad, And The Painful

Good
One of my friends helped with the install and it is remarkably quick when everything works (in my case the Ubuntu LTS 6.0.6 installer had trouble with the NVidea display card and came up correctly at the third attempt).
Bad
A one CD install is nice -- but after it you have remarkably little installed from the perspective of an emacspeak user. You end up with a very nice GUI but very little else --- the reasoning being that the average user wont need much more, and the savvy user can always run apt-get.
Bad
Worse, Ubuntu does not install openssh-server --- it limits itself to installing openssh-client. This means that you cannot bootstrap yourself by logging in from another machine until you install openssh-server off the network. If there was one thing I would ask the Ubuntu maintainers, it would be to rectify this situation.
Painful
In my case, the apt suite of tools appeared to have a problem --- they died saying /var/lib/dpkg/available: no such file or directory. Googling showed this to be a known problem with apt and the fix is to run dselect update -- but if you're new to Debian/ubuntu, this is less than obvious.
Good
Once you overcome the above, apt-get got me emacspeak-17.0 which was sufficient to let me bootstrap the rest of the process on my own using my trusted Dectalk Express to produce speech.
Painful
Note that you should install tcl8.3 and tclx8.3 --- rather than the newest (8.4) versions of these packages. This is because as of 8.4, the maintainers of those packages no longer build a stand-alone tcl (extended TCL) shell. This is something that will have to be handled by Emacspeak in the future.
Good
I was able to get everything I needed (and more) installed using a combination of apt-get and aptitude.
Bad
The IBM TTS engine no longer works --- under FC3 and friends, you needed to install package libstdc++-compat to get it to work. Well, there is no corresponding package for Ubuntu/Debian from what I could find out, and pulling in the RPM for libstdc++-compat, converting it via alien and installing the result produces a segfault when you run the TTS engine.
Bad
For the same reason, the old command-line trplayer will also not work on Ubuntu 6.0. This is not as painful --- since mplayer works --- though I had to build mplayer from source. It would be nice to create a command-line player on top of the HelixPlayer code base. At present, the missing trplayer means that the etc/rivo.pl provided by emacspeak no longer works. You can use mplayer to convert realaudio to mp3; however mplayerdoes not have a command-line option to specify the duration of playback, something that script etc/rivo.pl needs.

Thursday, September 07, 2006

Google Archive News Search

To mark the arrival of Google News Archive search, I checked in a Archive News Search url-template yesterday morning. To use it, hit C-e u followed by arc tab and specify your search term.

The above is checked into the SVN repository at Emacspeak GoogleCode.

Friday, August 25, 2006

Update: Emacspeak On Google Code Hosting

The initial experiment of moving emacspeak development to Subversion at Google Code Hosting has been largely successful. After a few bumps along the road, mostly a consequence of my being new to SVN, things are looking good, and I have stopped updating the CVS repository on SourceForge.

Some additional goodies as a consequence of the move to SVN:

  • SVN Tags contains snapshots of prior releases.
  • Future releases will come with an SVN Revision number that allows one to reliably recreate a released version.

Sunday, August 13, 2006

Emacspeak Codebase Via Subversion From GoogleCode

I've checked in the Emacspeak codebase into the Subversion repository provided by Google Project Hosting . The project page is Emacspeak at GoogleCode. You can find Emacspeak --- complete with its code history going back to the point where I started using CVS at Emacspeak SVN Repository.

For now, the Emacspeak Web site will continue to live at Sourceforge; The Emacspeak mailing list will continue to live at Vassar as before. To checkout the code from SVN, follow the instructions on Emacspeak SVN. If you run into any hitches in checking out the code, please report it on the Emacspeak mailing list. Note that you can anonymous checkout the code from the above location entirely from the shell command-line without ever having to point a browser at anything.

Emacspeak users presently running out of SourceForge CVS might want to do an SVN checkout in a separate directory and make sure things work, in preparation for a permanent switch-over to svn. Here are the minimal steps you need to perform:

  • svn checkout http://emacspeak.googlecode.com/svn/trunk/ emacspeak
  • The above will create a directory called emacspeak with the code under it; obviously, you should do this somewhere different from where you have your current copy of emacspeak.
  • For now, I recommend renaming the directory created in the above step to svn-emacspeak so that you can easily tell which snapshot you're looking at.

Note that reading these is not a replacement for learning about SVN --- there is an excellent on-line book available at SVN Manual.

Thursday, August 10, 2006

Zipping Through Web Pages

Zipping Through Web Pages With Emacspeak/W3

I just added an experimental zip through Web pages shortcut to emacspeak-w3. The command is called emacspeak-w3-speak-next-block and is bound to z in all W3 buffers. It is useful for quickly moving through Web pages that have logically separate content units in separate blocks where a block is one of:

  • HTML div.
  • HTML tables.
  • HTML p elements.

In general this provides an effective means of skimming many large Web pages.

Sunday, July 23, 2006

Summary Of Emacspeak Features Compared To Other Alternatives

Introduction

I've received a number of queries asking about the differences between Emacspeak and Speechdel ---especially given some of the somewhat confusing assertions made in recent Speechdel release announcements. I'm posting this article in the hope of clearing up some of this confusion.

1 Emacspeak And Speechdel -*- mode:org -*-

1.1 Background

Emacspeak speech-enables Emacs by advising core emacs functionality. Speech services are provided by a simple Emacspeak speech-server. Additionally, Emacspeak implements speech-extensions for popular emacs modules --- see the speech-enabled applications list.

Emacspeak was first released in 1995, and then (as now), there was limited speech access to the Linux GUI. Therefore, to be useful as a complete access solution, Emacspeak has always needed to enable the user to do everything from within Emacs, not just regular editing operations. As a case in point, emacspeak users are probably one of the last remaining communities that use Emacs for browsing the Web.

1.2 Speech Dispatcher (SpeechD)

The idea of SpeechD --- peech Dispatcher as an intermediate layer between speech clients and TTS engines was first floated sometime in the late 90's. Such a common layer is a laudible goal but is something that takes time and effort to get right. Additionally, you have the challenge of geting existing software e.g., emacspeak, to abandon their own speech abstraction and re-implement against a supposedly more generic, but completely untested and untried intermediate layer.

The developers of SpeechD initially incorporated some of the Emacspeak code into an Emacs wrapper (speechdel) that called SpeechD, but later decided to go their own way -- and present speechdel is the result.

Like Emacspeak, speechdel uses Emacs Lisp's advice facility to add spoken feedback to core editing commands; speech output is produced by calling out to speech-dispatcher.

The summary of feature differences between Emacspeak and speechdel in the next section is from examining the speechdel code-base; I have not run speechdel since its dependency chain resulting from speechd was difficult to resolve on my FC3 64bit machine.

1.3 Emacspeak Features Not Found In SpeechDel

  1. Emacspeak implements Aural CSS ACSS, and uses it to provides the aural analog of font-lock.
  2. Emacspeak provides pronunciation dictionaries. Pronunciations can be defined on a per-mode, per-buffer or per-directory basis. Directory and mode specific pronunciations are persisted across sessions. This allows Emacspeak to leverage Emacs' intelligence about the semantics of a given application; thus, you can have it say "p arrow x" for "p->x" when editing C code. Per-directory pronunciations are useful for reading electronic books. Per-buffer pronunciations are useful for succinctly speaking long lines of shell output e.g. when compiling complex software.
  3. By advising core Emacs functionality, Emacs modes work out of the box with Emacspeak. But in most cases, Emacspeak goes one step further by providing light-weight speech-modules that specialize spoken output for a given mode. As an example, advising next-line to speak the current line is sufficient to use dired-mode --- but having to listen to the entire line of dired output is not a pleasant experience. The dired-specific module in Emacspeak advises all interactive dired commands to speak the "right" information. As an another example, GUD interaction automatically speaks the line of source-code without leaving the Gud buffer.
  4. Emacspeak comes with many "Emacs Applets" for performing tasks that most users would perform outside of Emacs. Examples include playing CDs, playing multimedia streams etc. Fortunately, I have not had to write too many of these since there are always Emacs users other than myself who also create such Emacs applications --- so where Emacs applications already exist, I merely speech-enable them with a small set of advice definitions, and in some cases add a few additional interactive commands.
  5. Emacs applications are plentiful for most tasks; one exception is the Web. Since emacs/w3 development was abandoned sometime around 1998, I have added significant Web interaction functionality to Emacspeak using Emacs/W3 as the basis. Today, a lot of this has also been ported to Emacs/W3M thanks to other enthusiasts on the Emacspeak mailing list. Examples include:
    1. WebSearch module --- prompts for query and processes response to focus on the results.
    2. XSLT pre-processing: Allows pre-processing of complex pages before rendering via W3. Used to enable smart screen-scrapers using XPath.
    3. URL-Tempaltes: Originally motivated by webjump.el, this provides url templates that enable easy access to a variety of Web tasks rangig from looking up flight times to listening to your favorite NPR or BBc show. Think early cut at a "Web Command Line in the minibuffer".
  6. Customization via Custom, including additional keymaps. Comes with additional keymap files for the Linux console to enable hyper, super, and alt prefix keymaps.
  7. Module emacspeak-wizards iplements a large collection of Emacs wizards that enable common tasks that you would otherwise perform at the shell e.g., checking display status on a laptop. The additional prefix keymaps come in handy!
8)Finally, note that all modules (except the core) are loaded on demand.All code is compiled with byte-compile-dynamic set to =T= and individual application-specific modules are kept completely independent of one another. Given the size of the Emacspeak codebase, this is a pre-requisite for both efficiency and developer sanity.

Author: TV Raman <raman@users.sf.net>

Thursday, July 20, 2006

Emacspeak And Accessible Search Via Google

Google has released an early experiment that favours easy to read Web content --- checkout the relevant Blog post here. Emacspeak has always had a set of Google Websearch tools --- and this set has now been enhanced with a shortcut to Accessible Search. Below, I'll summarize the set of Google Websearch tools in Emacspeak.

All Emacspeak Websearch tools are reached via the key-sequence C-e?. Specific search tools are selected by single-letter keystrokes following C-e? --- I'll enumerate some of these below.

i
Accessible Search --- Google Web Search that favors accessible content.
g
Vanila Google Search.
space
Google I'm Feeling Lucky --- takes you directly to the first search hit.
n
Google News Search.
e
EmapSpeak Via Google Maps.
u
Google Usenet Search.

Note that in addition, module emacspeak-url-template provides a number of Google tools as smart URLs.

Friday, June 23, 2006

ALSA And Emacspeak: Closing The Legacy Loop With ALSA-OSS

And now, with ALSA working well with software TTS and cooperating with ALSA_aware streaming applications such as mplayer it's time to close the legacy loop for those few applications that still have the old OSS API hard-wired.

One such useful application is trplayer --- the command-line real player that has not been updated in over 4 years. For the most part, the functionality provided by trplayer is subsumed by the newer --- and actively maintained --- mplayer but it's still useful to have trplayer for times when mplayer hits gliches with slow-responding RTSP streams.

The ALSA way of handling such legacy applications is through the ALSA OSS emulation layer; Emacspeak now contains a script etc/atrplayer that invokes trplayer via aoss. Incidentally for the more observant Emacspeak user running out of CVS, script atrplayer is not new; it has been around for about a year, but until now it used command vsound to stream the converted audio to command aplay. I needed to do this until ALSA 1.0.11 since trplayer used to fail sporadically if run through the AOSS emulation layer. But those problems now seem to be in the past with the upgrade to ALSA 1.0.11. As usual with cutting edge technology like ALSA, your mileage with all of this will vary; so let me end with the usual disclaimer --- if it breaks, you get to keep both pieces.

Monday, June 19, 2006

SpeakFreely, Software TTS And ALSA

In ALSA and ASYM I mentioned that speakfreely appeared to have stopped working. As it turns out, this had nothing to do with the switch to ASYM. I believe that in the past I had run speakfreely by first killing software TTS --- since by default speakfreely uses OSS.

Getting speakfreely working with ALSA without losing software TTS required the following steps;

  1. Retrieve the latest tarball speak_freely-7.6a.tar.gz
  2. Uncomment the ALSA specific line in its Makefile
  3. In file audio_alsa.c, change the default audio device from plughw:0,0 to default. Without this change, speakfreely will try to access the sound card directly; setting it to default on line 41:
    char *devAudioOutput = "default";
    
    matches things up with the pcm.default that was configured in the .asoundrc.

With this, you can now talk using speakfreely and continue to use software TTS.

Tuesday, June 06, 2006

Emacspeak, TTS, Alsa And ASYM

This is a continuation of the earlier thread about using ALSA for software TTS using DMix --- see ASoundrc And Emacspeak.

I've now updated the CVS version of ASoundRC to use the ASYM plugin for the default ALSA device. The ASYM plugin allows you to configure both the playback and capture device, which removes the annoyance of having to specify an ALSA device when calling arecord --- as used to be the case when using DMIX in the pcm.default device.

Possible Caveats: I am having trouble getting speakfreely to work reliably --- I've used it with ALSA in the past --- though I'm not sure if the ASYM plugin is the culprit.

Monday, May 22, 2006

ASoundrc Parameters For Reliably Using ALSA Powered Software TTS

Advanced Linux Sound Architecture ALSA is a boon for software TTS users --- you can now use your soundcard to produce spoken output while not losing audio output from other applications such as music players and streaming radio stations.

Emacspeak implements an ALSA-enabled TTS server for the IBM ViaVoice engine --- using this server effectively requires appropriately tuning the parameters in the user's asoundrc file to:

  • Enable the DMix plugin to enable software mixing of multiple channels of audio.
  • To configure the various parameters ALSA itself uses.

Depending on how well your sound-card is supported by ALSA, the above can be either trivially simple or a tedious process of trial and error. I'm writing this up to:

  • Collect a list of sound cards on which the asoundrc provided with Emacspeak works as expected.
  • In the hope that the wider ALSA community discovers and helps flesh out this material; my hope is that the ALSA community has more insight into how these settings work.

For the above, works effectively means the following:

  • The TTS engine speaks without perceptible stuttering or other audio artifacts.
  • The engine is responsive with respect to starting and stopping speech; especially when typing fast at high speech rates.
  • The TTS engine does not interfere with other alsa-enabled applications, e.g. mplayer.

At the end of this entry, you can find the relevant section from the asoundrc file from the Emacspeak distribution, with comments indicating which sound cards perform well. An example of a card that does not work well with these settings is the Audigy-LS from Creative; the TTS engine works on that card, but performs degrades:

  • mplayer cannot use the audio device; (aplay and mpg321 are able to share the card with the TTS engine.)
  • Speech does not stop immediately as on the soundcards enumerated in the asoundrc file.
  Id: asoundrc,v 1.3 2006/05/23 00:22:16 raman Exp $
#these numbers work on the following:
# aplay -l | head 1
# I82801DBICH4 [Intel 82801DB-ICH4] (IBM Thinkpads)
# ICH6 [Intel ICH6],

#  default device is a mixer

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.dmixer  {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        format s16_LE
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

Wednesday, May 03, 2006

Listening To The Web Through A Mobile Lens

The similarities between Web access issues faced by mobile users and those confronting eyes-free Web browsing are striking, and these similarities have often been used to advocate the creation of well-structured, accessible Web content. As an example of mobile-friendly content being a blessing for eyes-free spoken access to WebFormation, Emacspeak provides a mobile lens via the Google Mobile transcoder.

Here are a few convenient means of using the above within the Emacspeak Audio Desktop:

  • While browsing the Web using w3, press t on a link (command: emacspeak-w3-transcode-via-google) to view that link through the mobile transcoder.
  • Note that all links in the resulting mobile view automatically go through the transcoder.
  • To undo the effect of automatically viewing links in the mobile view through the transcoder, use t with a interactive prefix argument i.e., press C-u t to follow a link to view it in its original form.
  • Additionally, I bind command emacspeak-wizards-google-transcode to a convenient key so that I can launch Web sites using the mobile view.

I use this tool on a regular basis while commuting to work to browse mainstream news sites, it provides speech-friendly content that has the added benefit of downloading fast over a wireless link --- after all, this is Mobile content.

Tuesday, May 02, 2006

Announcing Emacspeak 24.0 (LiveDog)

For Immediate Release

San Jose, CA, (May 3, 2006)
Emacspeak-Alive: --- Bringing Live Access For Enlightened Users
--Zero cost of ownership makes priceless software affordable!

Major Enhancements

  1. emacspeak-muse: Speech-enabled Muse Mode
  2. emacspeak-ruby: Speech-enabled Ruby Mode
  3. emacspeak-m-player: Updated for new MPlayer
  4. emacspeak-sudoku.el: Speech-enabled SuDoKu
  5. New Option: tts-strip-octals
  6. emacspeak-keymap.el Updated keybindings
  7. lisp/atom-blogger.el Light-weight blogging tool
  8. emacspeak-atom-blogger: Speech-enables above
  9. voice-setup.el Custom support
  10. Multispeech related patches
  11. User contributed patches

Friday, March 10, 2006

W3: Minor Patch To Handle Content-Type application/xhtml+xml

Here is a minor patch to w3.el to allow it to handle content-type application/xhtml+xml. For all practical purposes (at least as far as W3 is concerned), this can be handled by the html parser/renderer; however since that content-type did not exist at the time W3 was written, it offers to download/save documents of that type. The attached patch fixes this, and also adds a fix to a minor irritant with decoding of multimedia attachments.

Index: w3.el
===================================================================
RCS file: /cvsroot/w3/w3/lisp/w3.el,v
retrieving revision 1.32
diff -b -c -r1.32 w3.el
*** w3.el	12 Jan 2003 22:10:25 -0000	1.32
--- w3.el	11 Mar 2006 02:24:52 -0000
***************
*** 34,39 ****
--- 34,40 ----
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  (require 'w3-sysdp)
+ (eval-when-compile (require 'mm-decode))
  (require 'w3-cfg)
  
  (or (featurep 'efs)
***************
*** 325,331 ****
  				  (mm-handle-media-type handle)))))
        ;; Fixme: can handle be null?
        (cond
!        ((equal (mm-handle-media-type handle) "text/html")
  	;; Special case text/html if it comes through w3-fetch
  	(set-buffer (generate-new-buffer " *w3-html*"))
  	(mm-disable-multibyte)
--- 326,333 ----
  				  (mm-handle-media-type handle)))))
        ;; Fixme: can handle be null?
        (cond
!        ((or (equal (mm-handle-media-type handle) "application/xhtml+xml")
!          (equal (mm-handle-media-type handle) "text/html"))
  	;; Special case text/html if it comes through w3-fetch
  	(set-buffer (generate-new-buffer " *w3-html*"))
  	(mm-disable-multibyte)

Wednesday, March 08, 2006

Blogging From Emacs: Additional Atom-Blogger Documentation

Thanks to Jason Dunsmore for writing up some additional step-by-step documentation on using atom-blogger.

Thursday, February 23, 2006

Emacspeak: Connecting Lynx And W3

Emacs/W3 is still the best Web page rendering option inside Emacspeak given the ability to apply XSL transforms, as well as obtaining aural styling via ACSS. However W3's url handling layer often breaks when faced with multiple redirects, especially when some of these happen through the Host: HTTP header. Additionally, HTTPS authentication sometimes fails mysteriously in the presence of redirects.

In many of these cases, lynx happily fetches the pages correctly; however you're then stuck using a fairly weak auditory interface in that Emacspeak degrades to being aterminal level screenreader.

An effective solution to this problem is to use lynx within an Emacs terminal, and after finding the content that is worth reading, handing off that content to Emacs/W3. The next few paragraphs show how.

The lynx-site.cfg File

This is where you add site-specific configurations. Here are the lines I have in my lynx-site.cfg to integrate lynx and Emacs. Before you use any of this, make sure you have executed M-x server-start in your running Emacs, and make sure that all is well by experimenting with emacsclient to ensure that external programs can hand-off editting tasks to the currently running Emacs.

#site defaults
#for bookshare:
DOWNLOADER:BKS Unpack:bks.pl  %s %s:TRUE 
PRINTER:Edit:emacsclient %s:TRUE
KEYMAP:???:EDITTEXTAREA	# use external editor to edit a form textarea
PRETTYSRC:TRUE
SOURCE_CACHE:MEMORY
SAVE_SPACE:~/.wget/
BOLD_HEADERS:TRUE
PRINTER:W3:emacsclient -e '(w3-open-local "%s")':TRUE

Below, I'll describe what each of the above lines do:

  • DOWNLOADER:BKS Unpack:bks.pl %s %s:TRUE
    The above line creates an additional item in the download menu that invokes the BookShare unpacker. Script bks-unpack.pl invokes the BookShare unpack tool with the appropriate options.
  • PRINTER:Edit:emacsclient %s:TRUE
    This creates an Edit item in the print menu. Invoking this menu item causes the current page to be handed off to Emacs for editting. If you want to edit the source, first switch to source view by hitting \ before invoking print.
  • KEYMAP:???:EDITTEXTAREA # use external editor to edit a form textarea
    This sets lynx up so that when editting a multiline textarea, you can hand off the editting job to Emacs. This is particularly useful for editting Wiki pages. Replace the ?? with the desired key sequence.
  • PRETTYSRC:TRUE
    SOURCE_CACHE:MEMORY

    The above two settings make the edit source functionality more pleasant to use.
  • PRINTER:W3:emacsclient -e '(w3-open-local "%s")':TRUE
    The above creates a W3 menu item in the print menu. Invoking this causes Emacs/W3 to display the current page --- again switch to source view before invoking this so that Emacs/W3 gets handed the HTML markup.

Script bks-unpack.pl

#!/usr/bin/perl -w
#$Id: bks.pl,v 1.1 2003/07/04 15:41:55 tvraman Exp tvraman $
#Description: Bookshare downloader for Lynx
use strict;
my $location="$ENV{HOME}/books/book-share";
my $password = 'xxxxxxx';
my $grabbed = shift;
my $target = shift;
my $dir =qx(basename $target .bks);
chomp $dir;
my $where = "$location/$dir";
qx(mkdir -p $where);
qx(mv $grabbed  $where/$target);
chdir $where;
qx(echo $password | bks-unpack -q $target 1>&- 2>&- &);

Tuesday, February 21, 2006

Emacspeak, SuDoKu And History

Here is a small enhancement to playing SuDoKu in Emacspeak. The feature is probably generally useful i.e., it's not specific to eyes-free interaction, but its presence encourages one to try different solution strategies.

Commands emacspeak-sudoku-history-push bound to m and emacspeak-sudoku-history-pop bound to M allow one to mark interesting states in the game and return to these prior states with a single keystroke. This means that when one is confronted with one of two choices, with no apparent additional information on which route to take, it becomes possible to push that state on to the history stack, try one of the alternatives and backtrack if necessary.

Monday, February 20, 2006

Emacspeak And Voice Locking Using Aural CSS

This is slightly reformatted from what was posted to the Emacspeak mailing list as separate message.

  1. Emacspeak defines a number of voice overlays such as voice-bolden, and voice-lighten that can be applied to a given voice to change what it sounds like.
  2. Voice overlays are defined in terms of Aural CSS (ACSS) to keep them independent of a specific TTS engine.
  3. For each such overlay there is a corresponding <overlay-name>-settings variable that can be customized via custom.
  4. The numbers in voice-bolden-settings as an example:
Setting Value
family nil
average-pitch 1
pitch-range 6
stress 6
richness nil
punctuation nil
Unset values (nil) show up as "unspecified" in the customize interface.
  1. Do not directly customize voice-bolden and friends, instead customize the corresponding voice-bolden-settings, since that ensures that all voices that are defined in terms of voice-bolden get correctly updated.
  2. Discovering what to customize:

Command emacspeak-show-personality-at-point (bound by default to C-e M-v) will show you the value of properties personality and face at point. A recent update I implemented last weekend makes this more useful, so make sure you do a CVS update; earlier this command used to display the ACSS setting --- now it displays the abstract name. Describe-variable on these names should tell you what to customize; so as an example:

Put point on a comment line, and hit C-e M-v: you will hear

Personality emacspeak-voice-lock-comment-personality
Face font-lock-comment-delimiter-face

Describe-variable of emacspeak-voice-lock-comment-personality gives:

emacspeak-voice-lock-comment-personality's value is acss-p0-s0-all

Documentation:
Personality used for font-lock-comment-face
This personality uses  voice-monotone whose  effect can be changed globally by customizing voice-monotone-settings.

How It All Works

Here is a brief explanation of the connection between voice-bolden and its associated voice-bolden-settings.

  1. Voice settings are initially in voice-bolden-settings which is a list of numbers.
  2. That list of numbers needs to be translated to appropriate device-specific codes to send to the TTS engine.
  3. You do not want to do this translation each time you speak something.
  4. So when voice-bolden is defined, the definition happens in two steps:
  • The list of settings is stored away in voice-bolden-settings,
  • A corresponding voice-name is generated --- acss-a<n>-p<n>-r<n>-s<n> and the corresponding control codes to send to the device are stored away in a hash-table keyed by the above symbol.
  • Finally, voice-bolden is assigned the above symbol.

What this gives is:

  1. The ability to customize the voice via custom by editting the list of numbers in voice-bolden-settings
  2. When that list is editted, voice-bolden is arranged to be updated automatically.

Other Useful Commands

In addition, commands emacspeak-wizards-generate-voice-sampler can be useful in generating a buffer that shows what the various ACSS settings sound like. Command emacspeak-wizards-voice-sampler can be used to apply a specific voice to a region of text while experimenting with the various settings.