speaklib
Speak turns a text into phonemes with the translator library and has
the narrator device speak them, in the voice set with SetVoice. It
does not wait until the speech has ended; the next Speak or
PhoneticSpeak waits for the one before. Both need translator.library
and narrator.device on the Amiga; without them, a program that uses
these commands stops at its start with the error “Failed To Open Speech
Library”.
While Joyb(0)=0
SetVoice 100+Rnd(200),65+Rnd(255),1,1,64,22200
Speak "BLITZ BASIC"
WendBased on the speaklib guide by Acid Software.
Library number 88.
Commands
PhoneticSpeak
Speaks a string of phonemes as it is, for example from Translate$.
Statement. Help text: phonetic string
Arguments: $
SetVoice
The voice of the following Speak and PhoneticSpeak; values outside the ranges below are clipped.
Statement. Help text: rate(150),pitch(110),expression(1),sex,volume(64),freq(22200)
Arguments: .w, .w, .w, .w, .w, .w
The ranges are these:
| Setting | Range |
|---|---|
| rate | 40 to 400 words per minute |
| pitch | 65 to 320 Hz |
| expression | 0 for a natural, 1 for a monotone voice |
| sex | 0 for male, 1 for female |
| volume | up to 64 |
| sample frequency | 5000 to 28000 Hz |
A negative rate, pitch or sample frequency becomes the lowest value.
Speak
Translates the text into phonemes and speaks it, without waiting for the end.
Statement. Help text: string
Arguments: $
Translate$
The phonemes of a text, as PhoneticSpeak takes them.
Function, result $. Help text: returns phoneme translation of a string
Arguments: $
Fixed in the port: the original’s result ended in an extra 0 byte, one character too many (#277).
VoiceLoc
The address of the extra voice settings of the narrator device from version 37 on, inside the library’s narrator request, to change them with Poke.
Function, result .l. Help text: returns location of newvoice struct
No arguments.
They follow the narrator request of the operating system: flags (1 to use the extra settings), enthusiasm, perturbation, pitch and amplitude adjustments of the three formants, articulation, centralisation and its vowel, the biases of voiced and unvoiced sounds, and the priority.