Abram Hindle's Blog
   


About
Abram Hindle's Blog, The Personal Blog Of Abram Hindle

Abram Hindle
abezblog@abez.ca

Subscribe
Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.

Flavours
There's more than one way to view this weblog; try these flavours on for size.

  • index
  • circa 1993
  • RSS
  • Links
    These are a few of my favourite links.

           
    Fri, 16 Feb 2007

    Subject: Ric's brilliant idea
    During the last meeting, before Mike arrived, Ric and Abram were discussing editing techniques. Reading aloud was one technique, but it had the distinct failure of relying on your ability to not auto-correct your mistakes.

    Ric then came up with the idea of getting the computer to read your work to you. The computer reads accurately and perfectly, it only leaves out things it doesn't understand. It doesn't skip over double words like "the the" and doesn't say "blah blah" when a word is too long. Also, its tongue never tires.

    Anyways, in a fit of yak shaving I made an emacs macro that piped text from a region to festival (a CMU text2speech engine). I found that emacs blocked even if I ran festival with "&" to run in the background. So I made a daemonize script to run festival (I copied it from perldocs). So now when I hit ESC-\ on a region in emacs it pipes the text through untex and into festival, which then reads to text outloud to me using a Scottish voice.

    Was it helpful? Yes it was. I felt that it helped immensely. It would read text accurately and not skip words, a problem that I have. It wouldn't tire me out. It didn't hurt my eyes, I could just follow along slowly. The benefits of a speech synth is that it makes it apparent when your timing is off, when you are missing a comma. When a sentence is too long the voice runs out of breath. When a sentence keeps repeating similar sounding words too much you will notice it.

    Even more interesting is that it seems to use a different part of the brain to process what has been written. When you listen to something that is incorrect you can usually notice it. Anyways, it made editing a lot more fun and I felt more confident about it. Perhaps it was novelty, it seemed to work.

    If I wanted to check if what I wrote was correct I just made it read it out and it became pretty apparent if I was missing something.

    I've inlined the results of the yak shaving below (it didn't take a lot of time).

    I did a tiny bit of research and it seems some people advocate this, and some people even sell software to do this.

    Thanks for the great idea.

    abram

    Attachments:

    The macro in .emacs :

     (defun tex-speak ()
       (interactive)
       (shell-command-on-region (point)
                                (mark) "untex  - | texspeak" nil nil))
    

     (global-set-key "\M-\\" 'tex-speak)
    

    texspeak:

     #!/usr/bin/perl
     use POSIX qw(setsid);
     system("killall festival");
     my @in = <STDIN>;
     daemonize();
     $|=1;
     open(FD,"| festival $ENV{HOME}/scripts/festivaltts");
     print FD $_ foreach @in;
     sub daemonize {
         chdir '/'               or die "Can't chdir to /: $!";
         open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
         open STDOUT, '>/dev/null'
                                 or die "Can't write to /dev/null: $!";
         defined(my $pid = fork) or die "Can't fork: $!";
         exit if $pid;
         setsid                  or die "Can't start a new session: $!";
         open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
     }
    

    festivaltts:

     (voice_cmu_us_awb_arctic_hts)
     (tts_file "-")
     (quit)
    

     

    [] permanent link