AMOS Professional programmers are not restricted to printing words on screen. You can corn ma nd your Amiga to say them! This can be invaluable for people whose eyesight is impaired, for the creation of teaching programs for younger users, as well as for adding atmosphere to computer games and sheer fun. Before uttering its first words of the day, a Narrator device is loaded off disc automatically, and this takes a few seconds. After that, speech is almost instant. Obviously, hard disc users must remember to install the Narrator on hard disc before the Amiga will speak.
instruction: speak a phrase
Say text$
Say text$,mode
This is one of the simplest of all AMOS Professional commands to use, and it has one of the most satisfying results. Use the SAY instruction with a string of text, containing all the words and punctuation you want AMOS Professional to speak, like this:
Say "Welcome, everybody!"
Normally, all other instructions, music or sound effects will wait until AMOS Professional has finished speaking before they are executed. This default speech mode has a value of zero. By adding an optional mode value of 1, synthetic speech can be delivered while the rest of the program is being executed. This will necessarily slow down the relevant routines. To return to the default mode, use a line like this:
Say "Default mode.",0
Now get AMOS Professional to say anything you like, using the next simple routine, but please mind your language! Try experimenting with numbers and symbol characters too.
Do
Input "Please tell me what to say:";S$
S$=S$+"."
Say S$
Loop
If the Narrator system appears to fumble over a particular phrase, you are free to clarify things by adding spaces at the end of a sentence, or using phonetic spellings. As always, you cannot do any harm by experimenting.
instruction: set style of speech
Set Talk sex,mode,pitch,rate
The easiest way to test this command is to play with its parameters. These are given in the form of four values, and any of them can be omitted, providing the relevant commas are in position.
The parameters are as follows:
Sex can be set to zero for a male or 1 for a female voice. If you are not satisfied with these alternatives, zombies, leprechauns and much else besides can be created by playing with the other parameters.
The mode parameter uses zero for normal speech or 1 for a bizarre rhythmic pattern.
Pitch is the parameter that changes the audio frequency of the synthetic voice from a deep bass (65) up to a high soprano (320).
The final rate parameter tells AMOS Professional how many average-length words to recite per minute. This can range from a slow drawl (40) to complete gibberish (400).
Here are some examples:
Set Talk 1,1,, : Say "A rhythmic lady."
Set Talk 0,0,320,350 : Say "Bubbling fish face."
Set Talk ,,65,40 : Say "I'm a very lazy bullfrog."
Set Talk 0,,155,70 : Say "Hello, John Major speaking"
instruction: set volume and frequency for speech
Talk Misc volume,frequency
Existing AMOS users will find that the AMOS Professional speech facilities have been augmented and improved. The TALK MISC command allows you to set the volume and frequency of the narrator voice used for SAY instructions.
Synthetic speech can be delivered from a whisper to a shout, by setting the volume parameter between zero for silence, up to 64 for full volume. Frequency is directly adjusted by setting a value from 5000 to 25000, with some superb effects being generated at slower frequencies. Note that the higher the frequency setting, the more processor time will be taken in multitask mode.
Try this example:
For V=16 To 64 Step 8
For F=5000 To 25000 Step 5000
Talk Misc V,F
SAY "I think therefore I AMOS!"
Next F
Next V
instruction: stop speech in multitask mode
Talk Stop
This simple command is used to terminate synthetic speech delivered by a SAY instruction, while in multitask mode.
Another feature of the narrator device exploited by AMOS Professional is the MOUTH system, which can be displayed in multitask mode only. The MOUTH functions are used to govern the shape and movement of an animated mouth on screen, as follows:
function: return the width of animated mouth
width=Mouth Width
MOUTH WIDTH reports the width of the mouth at any instant, in pixels. This function will return a negative value if the current speech has finished.
function: return the height of animated mouth
height=Mouth Height
Similarly to MOUTH WIDTH, a negative value is returned if the speech is over, otherwise the current height of the mouth is given in pixels.
function: read position of animated mouth
position=Mouth Read
This function waits for a mouth movement, and then reads the new mouth values directly into the MOUTH WIDTH and MOUTH HEIGHT functions, as demonstrated by the usual ready- made example program.