|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Macros | |
| #define | LVO_Translate (-30) /* translator: a0 = in, d0 = len, a1 = out, d1 = size */ |
Functions | |
| void | _setvoice (void) |
| void | _voiceloc (void) |
| void | speaklib_libinit (void) |
| void | speaklib_libfinit (void) |
| ULONG | _translate (UBYTE *s, const ULONG *lens) |
| Translate$(string) - the phoneme translation of a text. | |
| void | _speak (const UBYTE *s, const ULONG *lens) |
| Speak string - translate a text into phonemes and speak it. | |
| void | _phospeak (UBYTE *s, const ULONG *lens) |
| PhoneticSpeak phonetic string - speak a string of phonemes. | |
| static void | libinit_c (void) |
| static void | libfinit_c (void) |
| static void | _setvoice_c (WORD rate, WORD pitch, UWORD mode, UWORD sex, WORD vol, WORD freq) |
| SetVoice rate,pitch,expression,sex,volume,freq - set the narrator's voice for the following Speak/PhoneticSpeak. | |
| BLITZ_ALIAS (_setvoice, _setvoice_c) | |
| static ULONG | _voiceloc_c (void) |
| VoiceLoc - the address of the request's V37 part (the newvoice fields). | |
| BLITZ_ALIAS (_voiceloc, _voiceloc_c) | |
| static void | translate (const UBYTE *s, ULONG len) |
| static void | say (const UBYTE *data, ULONG len) |
Variables | |
| static struct Library * | TransBase |
| struct { | |
| struct IOStdReq io | |
| UWORD rate | |
| UWORD pitch | |
| UWORD mode | |
| UWORD sex | |
| UBYTE * ch_masks | |
| UWORD nm_masks | |
| UWORD vol | |
| UWORD sampfreq | |
| UBYTE mouths | |
| UBYTE chanmask | |
| UBYTE numchan | |
| UBYTE v37 [19] | |
| } | ioreq |
| static UBYTE | audchan [4] = { 3, 5, 10, 12 } |
| static struct MsgPort | port |
| static WORD | initial |
| static UBYTE | spkbuff [4096] |
| static const char | report [] = "Failed To Open Speech Library" |
| void _phospeak | ( | UBYTE * | s, |
| const ULONG * | lens ) |
PhoneticSpeak phonetic string - speak a string of phonemes.
Sends the string as it is to narrator.device (CMD_WRITE, SendIO, the popped length), after waiting for the previous one. Leaves a3 = its argument (not a bug: a statement, a3 has no meaning after it). DIFF: a2 stays unchanged (the original pops the string length).
| s | d0: the phonemes |
| lens | a2: the string length on the stack (long) |
| void _setvoice | ( | void | ) |
|
static |
SetVoice rate,pitch,expression,sex,volume,freq - set the narrator's voice for the following Speak/PhoneticSpeak.
Clips the values and stores them in the request (MOVEM d0-d3,rate / MOVEM d4-d5,vol): rate 40-400, pitch 65-320, mode (expression) and sex & 1, volume at most 64, sample frequency 5000-28000. The values are signed words: -32768 is below every minimum.
Fixed (#279): the clipping compares signed (BGE/BLT); the original's word CMP and BPL/BMI (N flag only, no V) put large negative values whose difference to the limit overflows on the maximum.
| void _speak | ( | const UBYTE * | s, |
| const ULONG * | lens ) |
Speak string - translate a text into phonemes and speak it.
Translates the text (translator.library Translate, into a 1024 byte part of the 4K buffer) and sends the phonemes to narrator.device (CMD_WRITE, SendIO, length incl. the 0) without waiting; first waits for the previous Speak/PhoneticSpeak (WaitIO). DIFF: a2 stays unchanged (the original pops the string length).
| s | d0: the text |
| lens | a2: the string length on the stack (long) |
| ULONG _translate | ( | UBYTE * | s, |
| const ULONG * | lens ) |
Translate$(string) - the phoneme translation of a text.
Translates into the library's buffer and copies the phonemes over the argument (a3 = the argument's address); a3 ends on the 0. DIFF: a2 stays unchanged (the original pops the string length).
Fixed (#277): returns the length without the terminating 0 and leaves a3 on the 0; the original counted the 0 and left a3 behind it (the result one character too long, ending in the 0).
| s | d0: the text (also the result buffer) |
| lens | a2: the string length on the stack (long) |
| void _voiceloc | ( | void | ) |
|
static |
VoiceLoc - the address of the request's V37 part (the newvoice fields).
The 19 bytes after numchan in the narrator request, at an odd address.
| BLITZ_ALIAS | ( | _setvoice | , |
| _setvoice_c | ) |
| BLITZ_ALIAS | ( | _voiceloc | , |
| _voiceloc_c | ) |
|
static |
|
static |
|
static |
| void speaklib_libfinit | ( | void | ) |
| void speaklib_libinit | ( | void | ) |
|
static |
|
static |
| UBYTE* ch_masks |
| UBYTE chanmask |
|
static |
| struct IOStdReq io |
| struct { ... } ioreq |
| UWORD mode |
| UBYTE mouths |
| UWORD nm_masks |
| UBYTE numchan |
| UWORD pitch |
|
static |
| UWORD rate |
|
static |
| UWORD sampfreq |
| UWORD sex |
|
static |
|
static |
| UBYTE v37[19] |
| UWORD vol |