text2speech library  v0.5.5
C language translation of Phil Pilgrim's Phonemic Speech Syntesizer pronouces phonetically spelled phrases in strings.
Macros | Functions
text2speech.h File Reference

Pronounces words spelled out phonemically. This library is a spin2cpp.exe translation of Phil Pilgrim's Phonemic voice synthesizer library. Phil's library builds on Chip Gracey's VocalTract module to produce phonemic-based speech. The formant values it uses are based heavily on work done by D.H. Klatt in the "KLSYN" formant synthesis program. More...

#include <stdint.h>

Go to the source code of this file.

Functions

talk * talk_run (int pin, int npin)
 Run a talk process, uses a cog. More...
 
void talk_end (talk *talkId)
 End a talk process and recover a cog. More...
 
int32_t talk_set_speaker (talk *talkId, int32_t spkr, int32_t base)
 Create speaker numbers, each with a unique tone. More...
 
int32_t talk_spell (talk *talkId, char *ptr)
 Pronounce the letters in a character string. More...
 
int32_t talk_say (talk *talkId, char *ptr)
 Pronounce speech using strings spelled phonetically. Make sure to look over the function details (follow the talk_say link) for lots more info. More...
 
void talk_setVolume (talk *self, int level)
 set volume for all speakers. More...
 

Detailed Description

Pronounces words spelled out phonemically. This library is a spin2cpp.exe translation of Phil Pilgrim's Phonemic voice synthesizer library. Phil's library builds on Chip Gracey's VocalTract module to produce phonemic-based speech. The formant values it uses are based heavily on work done by D.H. Klatt in the "KLSYN" formant synthesis program.

Author
Parallax Inc using a spin2cpp.exe translation of Phil Pilgrim's Phonemic voice synthesizer library.
Version
0.55

Definition in file text2speech.h.

Function Documentation

◆ talk_end()

void talk_end ( talk *  talkId)

End a talk process and recover a cog.

Parameters
*talkIdThe pointer returned by talk_start that indicates which talk process is to be stopped.

◆ talk_run()

talk* talk_run ( int  pin,
int  npin 
)

Run a talk process, uses a cog.

Parameters
pinAn I/O pin to deliver signals. Use -1 if you don't want to use this I/O pin.
npinAn I/O pin to deliver the opposite of the pin signals. This is useful for differential signaling or sound over two headphone channels. Use -1 if you don't want to use this I/O pin.
Returns
A pointer to the talk process info for use as a process ID in other function calls.

◆ talk_say()

int32_t talk_say ( talk *  talkId,
char *  ptr 
)

Pronounce speech using strings spelled phonetically. Make sure to look over the function details (follow the talk_say link) for lots more info.

Parameters
*talkIdThe talk process ID.
*ptrThe address of a string of characters to pronounce as phonemes.

This program's "say" function accepts a string of bytes that represent English phonemes. It "speaks" them on the port given in the argument to "start". The string can include the following one- and two-character combinations:

#         Select speaker 0.
#n        Select speaker n (0 =< n =< 9).
_         Set the glottal pitch to the base frequency.
[         Raise glottal pitch by one semitone.
]         Lower glottal pitch by one semitone.
/         Slide the glottal pitch up by one semitone during the next frame.
\         Slide the glottal pitch down by one semitone during the next frame.
'         Accent the next frame (same as +\).
+         Raise the glottal pitch by one semitone. (i.e. "Sharp" the previous note.)
+n        Raise the glottal pitch by n semitones (n = "1" to "9").
-         Lower the glottal pitch by one semitone. (i.e. "Flat" the previous note.)
-n        Lower the glottal pitch by n semitones (n = "1" to "9").
A .. G    Set the glottal pitch to the indicated note in the current octave.
An .. Gn  Set the glottal pitch to the indicated note in octave n (n = "0" to "9").
%         Set the tempo to 100%
%nnnn     Set the tempo to nnnn% (25 =< nnnn =< 1600) Larger numbers = slower tempo.
<         Raise the volume by one notch.
>         Lower the volume by one notch.
~         Add a short "uh" to the end of the last letter (usually a consonant) for emphasis.
,         Short pause.
;         Medium pause.
.         Long pause.
(         Begin whispering.
)         End whispering.
|         Do not interpolate between previous and next phonemes.
<blank>   Syntactic separator. Prevents adjacent letters from being treated as a pair.
a         A as in At.
ae        Long I sound, as in bIte.
al        AL, as in pAL.
ai,ay     Long A sound, as in bAIt.
ar        AR, as in pARt.
ah,o      "ah" sound, as in pOt.
e         Short E sound, as in pEt.
ee        Long E sound, as in fEEd.
ew        EW, as in pEW.
er,ir     IR, as in gIRl 
el        EL, as in pELt.
i         Short I sound, as in hIt.
o         Short O sound, as in pOt.
oa        Long O sound, as in bOAt.
or        OR, as in fORt.
ol        "ahl" sound, as in mALl
ou,ow     OU, as in OUt.
oi,oy     OY, as in bOY.
oo        Long OO sound, as in bOOt.
u         Short U sound, as in gUt.
uu        Short OO sound, as in pUt.
d         D, as in Dog.
dh        Soft (voiced) TH sound, as in THat.
t         T, as in Tot.
th        Hard (unvoiced) TH sound, as in THink.
s         S, as in Sip.
sh        SH, as in SHip.
c,k       C, as in Cot.
ch        CH, as in CHip.
z         Z, as in Zoo.
zh        ZH sound, as in aZure.
l         L, as in Lot.
r         R, as in Rot.
rr        Rolled R, as in peRRo (Esp.).
w         W, as in Want.
y         Y, as in Yell.
m         M, as in Mom.
n         N, as in Name.
p         P, as in Pop.
g         G, as in Good.
b         B, as in Bad.
f         F, as in Fad.
h         H, as in Had.
v         V, as in Vat.
j         J, as in Job.

◆ talk_set_speaker()

int32_t talk_set_speaker ( talk *  talkId,
int32_t  spkr,
int32_t  base 
)

Create speaker numbers, each with a unique tone.

Parameters
*talkIdThe talk process ID.
spkrA number used to identify the speaker in other calls.
baseThe tone (default 100, higher for higher pitch, lower for lower pitch).
Returns
0

◆ talk_setVolume()

void talk_setVolume ( talk *  self,
int  level 
)

set volume for all speakers.

Parameters
*selfspeech2text process ID.
level(quietest) 0...7 (loudest).

◆ talk_spell()

int32_t talk_spell ( talk *  talkId,
char *  ptr 
)

Pronounce the letters in a character string.

Parameters
*talkIdThe talk process ID.
*ptrThe address of a string of characters to pronounce as letter names.
Returns
0