Talkie
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Talkie Class Reference

Talkie is a software implementation of the Texas Instruments speech synthesis architecture (Linear Predictive Coding) from the late 1970s. More...

#include <Talkie.h>

Public Member Functions

 Talkie (Print &out, int channelCount=1)
 
void setOutputAsText (bool flag)
 converts samples to csv string format
 
void say (const uint8_t *address)
 converts the provided word into samples
 
void silence (uint16_t ms)
 outputs silence for the indicated milliseconds
 
void sayPause ()
 
void sayDigit (char aDigit)
 
void sayVoltageMilliVolts (long aMilliVolt)
 
void sayVoltageVolts (float aVolt)
 
void sayTimeout ()
 
void sayNumber (long aNumber)
 say any number between -999,999 and 999,999
 
void sayFloat (float aFloat, int aDecimalPlaces, bool aSuppressLeadingZero, bool aSuppressTrailingZero)
 
void setOutput (Print &out)
 Defines the Arduino data target.
 
void setDataCallback (void(*cb)(int16_t *data, int len))
 Defines the data callback that receives the generated samples.
 
void setChannels (uint16_t ch)
 Defines the number of generated output channels (2=stereo). Default is 1 = mono.
 

Protected Member Functions

void wait ()
 
void setPtr (const uint8_t *addr)
 
uint8_t rev (uint8_t a)
 
uint8_t getBits (uint8_t bits)
 
void say1 (const uint8_t *addr)
 
int clip (int value, int min, int max)
 
void writeSample (int16_t sample)
 
bool process ()
 
bool calculateSample ()
 

Protected Attributes

Print * p_print = nullptr
 
uint16_t channels = 1
 
bool isInit = false
 
bool isOutputText = true
 
const uint8_t * ptrAddr = nullptr
 
uint8_t ptrBit
 
uint8_t synthPeriod
 
uint16_t synthEnergy
 
int16_t synthK1
 
int16_t synthK2
 
int8_t synthK3
 
int8_t synthK4
 
int8_t synthK5
 
int8_t synthK6
 
int8_t synthK7
 
int8_t synthK8
 
int8_t synthK9
 
int8_t synthK10
 
void(* data_callback )(int16_t *data, int len) = nullptr
 
uint8_t tmsEnergy [0x10]
 
uint8_t tmsPeriod [0x40]
 
uint16_t tmsK1 [0x20]
 
uint16_t tmsK2 [0x20]
 
uint8_t tmsK3 [0x10]
 
uint8_t tmsK4 [0x10]
 
uint8_t tmsK5 [0x10]
 
uint8_t tmsK6 [0x10]
 
uint8_t tmsK7 [0x10]
 
uint8_t tmsK8 [0x08] = {0xC0, 0xD8, 0xF0, 0x07, 0x1F, 0x37, 0x4F, 0x66}
 
uint8_t tmsK9 [0x08] = {0xC0, 0xD4, 0xE8, 0xFC, 0x10, 0x25, 0x39, 0x4D}
 
uint8_t tmsK10 [0x08] = {0xCD, 0xDF, 0xF1, 0x04, 0x16, 0x20, 0x3B, 0x4D}
 
uint8_t chirp [CHIRP_SIZE]
 
int16_t nextSample = 0
 
uint8_t periodCounter = 0
 
int16_t x [10] = {0}
 

Detailed Description

Talkie is a software implementation of the Texas Instruments speech synthesis architecture (Linear Predictive Coding) from the late 1970s.

Author
Peter Knight, Phil Schatzmann

Member Data Documentation

◆ chirp

uint8_t Talkie::chirp[CHIRP_SIZE]
protected
Initial value:
= {
0x00, 0x2a, 0xd4, 0x32, 0xb2, 0x12, 0x25, 0x14, 0x02, 0xe1, 0xc5,
0x02, 0x5f, 0x5a, 0x05, 0x0f, 0x26, 0xfc, 0xa5, 0xa5, 0xd6, 0xdd,
0xdc, 0xfc, 0x25, 0x2b, 0x22, 0x21, 0x0f, 0xff, 0xf8, 0xee, 0xed,
0xef, 0xf7, 0xf6, 0xfa, 0x00, 0x03, 0x02, 0x01}

◆ tmsEnergy

uint8_t Talkie::tmsEnergy[0x10]
protected
Initial value:
= {0x00, 0x02, 0x03, 0x04, 0x05, 0x07, 0x0a, 0x0f,
0x14, 0x20, 0x29, 0x39, 0x51, 0x72, 0xa1, 0xff}

◆ tmsK1

uint16_t Talkie::tmsK1[0x20]
protected
Initial value:
= {
0x82C0, 0x8380, 0x83C0, 0x8440, 0x84C0, 0x8540, 0x8600, 0x8780,
0x8880, 0x8980, 0x8AC0, 0x8C00, 0x8D40, 0x8F00, 0x90C0, 0x92C0,
0x9900, 0xA140, 0xAB80, 0xB840, 0xC740, 0xD8C0, 0xEBC0, 0x0000,
0x1440, 0x2740, 0x38C0, 0x47C0, 0x5480, 0x5EC0, 0x6700, 0x6D40}

◆ tmsK2

uint16_t Talkie::tmsK2[0x20]
protected
Initial value:
= {
0xAE00, 0xB480, 0xBB80, 0xC340, 0xCB80, 0xD440, 0xDDC0, 0xE780,
0xF180, 0xFBC0, 0x0600, 0x1040, 0x1A40, 0x2400, 0x2D40, 0x3600,
0x3E40, 0x45C0, 0x4CC0, 0x5300, 0x5880, 0x5DC0, 0x6240, 0x6640,
0x69C0, 0x6CC0, 0x6F80, 0x71C0, 0x73C0, 0x7580, 0x7700, 0x7E80}

◆ tmsK3

uint8_t Talkie::tmsK3[0x10]
protected
Initial value:
= {0x92, 0x9F, 0xAD, 0xBA, 0xC8, 0xD5, 0xE3, 0xF0,
0xFE, 0x0B, 0x19, 0x26, 0x34, 0x41, 0x4F, 0x5C}

◆ tmsK4

uint8_t Talkie::tmsK4[0x10]
protected
Initial value:
= {0xAE, 0xBC, 0xCA, 0xD8, 0xE6, 0xF4, 0x01, 0x0F,
0x1D, 0x2B, 0x39, 0x47, 0x55, 0x63, 0x71, 0x7E}

◆ tmsK5

uint8_t Talkie::tmsK5[0x10]
protected
Initial value:
= {0xAE, 0xBA, 0xC5, 0xD1, 0xDD, 0xE8, 0xF4, 0xFF,
0x0B, 0x17, 0x22, 0x2E, 0x39, 0x45, 0x51, 0x5C}

◆ tmsK6

uint8_t Talkie::tmsK6[0x10]
protected
Initial value:
= {0xC0, 0xCB, 0xD6, 0xE1, 0xEC, 0xF7, 0x03, 0x0E,
0x19, 0x24, 0x2F, 0x3A, 0x45, 0x50, 0x5B, 0x66}

◆ tmsK7

uint8_t Talkie::tmsK7[0x10]
protected
Initial value:
= {0xB3, 0xBF, 0xCB, 0xD7, 0xE3, 0xEF, 0xFB, 0x07,
0x13, 0x1F, 0x2B, 0x37, 0x43, 0x4F, 0x5A, 0x66}

◆ tmsPeriod

uint8_t Talkie::tmsPeriod[0x40]
protected
Initial value:
= {
0x00, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2D, 0x2F, 0x31, 0x33,
0x35, 0x36, 0x39, 0x3B, 0x3D, 0x3F, 0x42, 0x45, 0x47, 0x49, 0x4D,
0x4F, 0x51, 0x55, 0x57, 0x5C, 0x5F, 0x63, 0x66, 0x6A, 0x6E, 0x73,
0x77, 0x7B, 0x80, 0x85, 0x8A, 0x8F, 0x95, 0x9A, 0xA0}

The documentation for this class was generated from the following file: