[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

4040.0. "Rexx Speak 1.1" by CSCOAC::KENDRIX_J () Wed Aug 22 1990 13:07

    I got permission from a friend of mine to post this program.  It has
    the capability of adding speach to your Arexx programs, OR to other
    applications which have the ability to call Arexx scripts!  It looks
    like a lot of fun, and I wanted to share it with you...
     
    
    The docs are in the reply to this message...
     
    JK
    
T.RTitleUserPersonal
Name
DateLines
4040.1Rexx speak docs!CSCOAC::KENDRIX_JWed Aug 22 1990 13:09254
    
    
     
    
    ----Rexx speak 1.1 is now appearing on Tape::user2:[upload]
    
    


                        -=-=-  RexxSpeak  -=-=-

                              Version 1.1

                            Written 04/27/90
                             by Steve Owens


              Give your ARexx programs the power of speech!


      RexxSpeak is an ARexx function host, written in C, that provides
      access to the internal routines for translating and speaking
      English text.  In order to use it, you must have the following
      items available:

            translator.library - usually found in the 'libs:' directory
            narrator.device    - usually found in the 'devs:' directory
            ARexx              - usually found on the finest systems

            It is advantageous to have WaitForPort in your C: directory,
            although StartRexxSpeak.rexx will function without it.  (It
            is a small command, so copy it from the ARexx distribution
            diskette if you haven't yet done so.)

      If you have those items, activate the host with:

            run RexxSpeak [quiet]

      The "quiet" option will override the default of NOISY (echo output
      to the screen), which may be useful when redirecting output;  see
      below.

      Once active, RexxSpeak will wait for a command to be passed from
      ARexx to its message port, which is named "RexxSpeak".  To
      communicate with RexxSpeak from your ARexx program, use this
      format:

            address RexxSpeak 'some text to be spoken'

      or, as illustrated in the sample programs (SpeakTest[n].rexx), you
      can set a default address, as in:

            address RexxSpeak         /* This is for ARexx            */
            .
            .
            .
            "Say 'goodnight', Dick"   /* This is routed to RexxSpeak  */
                                      /* and spoken                   */


      In keeping with ARexx itself, the message port's name (REXXSPEAK)
      must resolve to uppercase.  Therefore, if you enclose the name in
      quotes, you must enter it in caps.  In the two 'address' examples
      above, the name can be typed in mixed case, and the ARexx interpreter
      will fold it to uppercase because it is outside quotes.

      RexxSpeak was developed using Lattice C 5.05, AmigaDOS 1.3 and
      ARexx 1.10.




                           -=- Features -=-


      These commands alter RexxSpeak's characteristics and are not spoken
      spoken.  Each must be entered on a line by itself and must be in
      uppercase to be recognized as a command.  This allows you to speak,
      for example, the word 'quiet' by itself, as long as you type it in
      lowercase surrounded by quotes.

      Anything other than a command will be spoken.  The valid commands:

            - CLOSE    Shut down the host and release resources

            - RESET    Change all the options below to their defaults

            - QUIET    Turn off echo to screen

 (default)  - NOISY    Enable echo to screen

 (default)  - MALE     Male vocal tract - also resets PITCH

            - FEMALE   Female vocal tract - also resets PITCH

            - ROBOT    Very little rise and fall in speech pattern

 (default)  - HUMAN    Has rise and fall during a sentence

            - PITCH <number>  Baseline value in Hertz - <number> can
                       be between 65 and 320  (default: 110)

            - RATE <number>  Speed of speech - <number> can be between
                       40 and 400  (default: 150)

            - VOLUME <number>  Must be greater than 0 and less than 65.
                       (default: 64)

            - SHOWTRANS Display the output of the text translation done
                        by RexxSpeak.  This will cause the phoneme
                        representations of the English text to be written
                        to the screen even if QUIET has been specified.
                        See the section "Bypassing Translation" for more
                        details on using this option.

 (default)  - NOSHOWTRANS  Keep text translation results hidden.

            - NOTRANS   Bypass the translation step and feed all non-
                        command input directly to the narrator.device
                        for speech.  This requires you to encode phonemes
                        and emphasis using the "Arpabet" scheme.  See
                        the section "Bypassing Translation" for more
                        details on using this option.

 (default)  - TRANS     All non-command input will be fed through the
                        text-to-phoneme translator.

      "Echo to screen" means the text being spoken will also be written
      to your CLI window (or a specially-opened window if run from an
      icon) so you can read while you listen (aka "multitasking").

      Changes made to a characteristic generally last until it is changed
      again, a RESET command is issued, or the host port is closed and
      reopened.

      The exceptions to this are the MALE and FEMALE commands, which
      change the PITCH settings as well.  This makes it easier to switch
      between the two.  If you want to have a husky female sound, you
      can set the PITCH after issuing the change to FEMALE.




                      -=- Bypassing Translation -=-


      If you try running some of the SpeakTest examples, you will hear
      some rather odd guesses made by the Translate() function.  One
      way around this is to deliberately misspell your text.  With some
      experimenting, you can usually come up with a resonable-sounding
      alternate spelling.

      For the best-quality speech, however, you might want to get one
      step closer to bare metal by doing the text-to-phoneme translation
      yourself.  RexxSpeak gives you the option to try this through the
      NOTRANS command.

      Appendix H of the Amiga Basic manual (at least in the 1.2 vintage)
      has a condensed version of the information in the Rom Kernel Manual
      describing a way to represent the International Phonetic Alphabet
      (I.P.A.) using "Arpabet".  This was developed under the auspices
      of the Advanced Research Projects Agency (ARPA) and is a way of
      coding phonemes and inflections using one or two-letter combinations
      and 0-9 for emphasis.

      Note that when using NOTRANS, there is no room for error.  If one
      of the Arpabetic strings is mistyped, the narrator will not continue
      to speak that sentence.  For example, 1.2 RKM has a sample paragraph
      about a certain heart disease.  The second sentence is missing the
      "/" prefix from the translation of "heard" and will not be processed
      as printed.

      If an emphasis number is coded in the wrong position in the string,
      that is also considered an error, and the narrator will stop.

      As such strict coding requirements may be a bit daunting at first,
      I've provided a means for you to get a head start.  Using a
      combination of the SHOWTRANS command and AmigaDOS command-line
      redirection, you can create a file containing phonetic translations
      of the text strings passed to RexxSpeak.

      The redirection requires that RexxSpeak be started with something
      like the following:

            run RexxSpeak >RAM:phonetic.translation [quiet]

      When invoked in this fashion, RexxSpeak will put everything normally
      destined for the screen into the ram disk file "phonetic.translation".
      Then in your ARexx program, issue the SHOWTRANS command to have
      RexxSpeak pass along the output of the Translate function.

      If the "quiet" option is specified, the startup message will not
      be displayed and RexxSpeak will begin in non-NOISY mode.  If you
      wanted to have both the English text and its corresponding phonemes
      for comparison, you would omit "quiet".

      Once you have an initial Arpabetic translation (even if it is
      mispronounced), you can hack on it to make it sound just the
      way you want.

      An example of this technique can be found in "SpeakTest5.rexx".
      "SpeakTest6.rexx" shows how this output might be used by another
      ARexx program.  Try running them back-to-back in numerical order.




                     -=- Running From Workbench -=-

      If you give the Project icon for your ARexx program the proper
      default tool ("rx"), you can run an ARexx program from the
      Workbench just by double-clicking on an icon.  If your program
      is coded in the manner of "Speaktest.rexx", you can also have
      RexxSpeak started up automatically.

      I've included icons with the sample programs if you wish to try
      out this method of launching ARexx programs.  The programs RX
      and WaitForPort must be available in your C: directory.




                            -=- Future -=-

      I originally thought this should be a shared library, but as I
      began to add "interactive" features, the function host seemed to
      be a better platform after all.  Any ideas on where the line between
      the two should be drawn?

      I've added the ability to change most of the narrator.device's
      changeable items, so any new features will have to come out of
      thin air.

      How about a TRUE text file reader?  In hex, too!?  RexxSpeak could
      combine with ROBBS, RexxArpLib, and other ARexx enhancement packages
      for some interesting projects.  The possibilities are limited only
      by your procrastination...


      RexxSpeak is entered into the Public Domain.


      Comments/Suggestions/Problems via:

          - AMIGA echo on InterLink

          - Amiga Programming on FidoNet  (probably...)

          - Amiga echo on RelayNet (possibly...)

          - U.S. Mail:
              1195 Clichy Court
              Marietta GA  30066
4040.2Kinda strange...EUCLID::OWENI will not instigate revolutionWed Aug 22 1990 14:436
    Just thought I'd let everyone know that I had nothing to do with the
    writing of this program before anyone sends me mail about it.
    
    Thanks,
    Steve Owen
    
4040.3Would the real Steve Owens Please....CSCOAC::KENDRIX_JWed Aug 22 1990 15:457
    re:.2
     
    Indeed Steve, I should have thought about that... My friends name is
    pretty close to yours, since his is 'Steve Owen(S)'.
     
    JK