|Power User: Backtalk||- by Jim Little|
've always been fond of articles that discuss interesting or unusual ways of using OS/2. However, it seems that many of these articles are aimed at the novice user. Since nobody was writing the type of "tips and tricks" columns I wanted to read, I decided to start my own. Thus was born "Power User."
The "Power User" column will be devoted to discussing unusual or innovative ways to use OS/2. Each column will discuss a "project" that will mix REXX, Workplace Shell manipulation, and freeware programs to create a useful or cool result. In keeping with its title, "Power User" is aimed at the advanced OS/2 user. I won't be explaining the projects in detail, although I will give an overview and an explanation of any unusual tricks used. Less-advanced users will still be able to benefit, however; each column will be accompanied by a downloadable installation program that will automatically set up the project on your machine.
This column needs good ideas to survive. I've got several projects planned, but I'm hoping that the majority of ideas will come from you, the readers. If you have an unusual Workplace Shell setup or a bunch of customized REXX scripts that perform your every wish, let me know. Even if your idea isn't large enough to be a project of its own, I can incorporate it into other columns. I'll also occasionally be publishing a compendium of smaller tips and tricks. In short: Send me your ideas!
With that out of the way, let's move on to this month's project.
By itself, RSynth is interesting, but not all that useful. After all, most people can read faster than they can listen. RSynth's real value appears when you integrate it into your REXX scripts. For example, imagine having your computer tell you when a lengthy batch job is complete. Or having your computer tell you when new e-mail has arrived, complete with the name of the sender and the subject of the message. Or even a talking alarm clock that informs you of appointments. Since it doesn't interrupt your current work, speech has a real advantage over a pop-up information window. And, of course, having your computer talk to you is just plain cool.
Unfortunately, integrating RSynth into your REXX programs isn't as simple as just calling the program. Access to RSynth has to be serialized... otherwise, if two programs try to run it at the same time, messages will be lost or garbled.
To resolve this problem, I used a REXX queue. Only one program, constantly running in the background, is allowed to call RSynth directly. This program sits and waits for messages to be added to the queue. As soon as a message is found, it is sent to RSynth. Other programs send their speech-bound messages to the queue, rather than calling RSynth directly. In addition to preventing multiple programs from accessing RSynth simultaneously, this approach has the additional advantage of allowing programs to issue special commands, such as "Mute," and have them affect speech from any program.
|COMMAND_MUTE||mutes speech and discards both pending and new messages|
|COMMAND_DISCARD||discards all pending messages; new messages are processed normally|
|COMMAND_NUMQUEUED||speaks the number of messages in queue|
To use SPEECHQ, you simply change the current queue to REXXSPEECH by using the RxQueue() function, then add your message to the queue by using either the Queue or the Push instruction. I recommend using Queue for messages and Push for commands. That way, messages are spoken in order, but commands occur right away. The example programs SPEECHSND.CMD and SPEECHCMD.CMD illustrate this use of the speech queue. SPEECHSND uses Queue, while SPEECHCMD uses Push.
In addition to the SPEECHQ program and examples, I've also included two REXX programs that use speech to perform a useful function. The first, SPKSTATS.CMD, uses Cheng-Yang Tan's UPTIME.EXE to voice some system statistics. The second, NEWMAIL.CMD, is a more complex program that is designed to be used with your e-mail program. Given the filename of an incoming message, it parses out the author's name and subject (with the aid of firstname.lastname@example.org's Unix to DOS text converter), converts them to a speech-friendly sentence, and sends this sentence to the speech queue. I've included instructions on using NEWMAIL.CMD with MR/2 ICE and PMMail 1.51 in the project zip file.
That's it for this month. You can download the Backtalk project via the link below. The project includes the REXX files discussed above, RSynth, Uptime, the Unix to DOS converter, and an installation program. You can also download these files separately. If you haven't installed the EMX runtime module yet, you'll need to download that as well. I also recommend that you download a pronunciation dictionary to go along with RSynth; I didn't include it in the project zip file because of its size, but installing it will greatly improve the quality of RSynth's speech.
Comments on this project or suggestions for future projects are welcome. I would particularly appreciate knowing about any improvements you make to my REXX programs. I'm also interested in any speech-enabled programs that you write. Contributions will be discussed in a future column.
Next month: REXX, the WPS, and some computerized sleight-of-hand combine to create a drag-n-drop MIDI jukebox.
EMX runtime (ZIP, 377k)
CMU Pronunciation dictionary (ZIP, 777k)
-- Copyright © 1996 - Falcon Networking
[Our Sponsor: Perez Computing Services - Makers of Ctrl-Alt-Del Commander and IPF Editor.]
This page is maintained by Falcon Networking. We welcome your suggestions.
Copyright © 1996 - Falcon Networking