The original version can be found here A good explanation of the TMS5220 operation and the LPC frame format can be found here
YouTube Demonstration of Talkie voltmeter example
- Improved code so Talkie now runs on 8 MHz Arduino (with millis() interrupt disabled while talking).
- Fixed the ISR_RATIO Bug for plain Arduino.
- Added utility functions sayQNumber(), sayQFloat(), sayQVoltageMilliVolts() extracted from the examples.
- Inverted output at pin 11 is enabled by default to increase volume for direct attached piezo or speaker.
- Added comments and did refactoring to better understand the functionality.
- Added compatibility to Arduino Tone library by stopping timer1 interrupts at every end of speech.
- Extracted initializeHardware() and terminateHardware() functions for easy adapting to other platforms.
- Currently supporting:
- ATmega328 as found on the Uno and Nano boards.
- ATmega2560 as found on the MEGA 2560 board.
- ATmega32U4 as found on the Leonardo and CircuitPlaygound boards.
- ARM0 (but not tested) as found on the SAMD, Teensy and Particle boards.
- ATmega328 (Uno and Nano): non inverted at pin 3, inverted at pin 11.
- ATmega2560: non inverted at pin 6, inverted at pin 7.
- ATmega32U4 (Leonardo): non inverted at pin 10, inverted at pin 9.
- ATmega32U4 (CircuitPlaygound): only non inverted at pin 5.
Timer 1 (Servo timer) is used at all ATmegas for updating voice output data at 8 kHz. Timer 2 (Tone timer) on ATmega328 and Timer 4 on ATmega2560 + ATmega32U4 is used to generate the 8 bit PWM output.
- As default both inverted and not inverted outputs are enabled to increase volume if speaker is attached between them.
- I use the speakers from old earphones or headphones, which have approximately 16 to 32 Ohm, directly without a series resistor. The headphone speaker tend to be much louder, especially when they stay in their original housings.
- The library uses Timer 1 and Timer 2 on ATmega328, so libraries like Tone, Servo, analogWrite(), and some other libraries cannot be used while speaking.
- After a call to
say...()
you can usetone()
again. - To use Servo
write()
after a call to say... you mustdetach()
andattach()
the servo before firstwrite()
in order to initialize the timer again for Servo. - If you want to use SPI functions on ATmega328 while Talkie is speaking, then disable Talkies usage of pin 11 by
Talkie Voice(true, false);
instead ofTalkie Voice;
orVoice.doNotUseUseInvertedOutput();
. - Porting to ATtinys is not possible, since they lack the hardware multiplication. ( Believe me, I tried it! )
To create LPC data you can use the python_wizard or BlueWizard for Mac OS X.
Another way to create LPC data is to use Qboxpro, an unsupported old Windows application running under XP, which can produce Talkie compatible data streams. The missing BWCC.DLL (Borland Windows Custom Control Library) can be found e.g. here. The process is described here and goes like this:
- Create a new project using the following project parameters : Byte / 8 KHz / 5220 coding table
- Goto Project and add the audio file
- Choose process using : medium bit rate and pressing OK
- Edit concatenation : insert concatenation after by adding a name; then insert phrase and press OK
- Format it by choosing the first line in the format menu : LPC 10V, 4UV
To access the Arduino library files from a sketch, you have to first use Sketch/Show Sketch Folder (Ctrl+K) in the Arduino IDE.
Then navigate to the parallel libraries
folder and select the library you want to access.
The library files itself are located in the src
sub-directory.
If you did not yet store the example as your own sketch, then with Ctrl+K you are instantly in the right library folder.
Consider to use Sloeber as IDE
If you are using Sloeber as your IDE, you can easily define global symbols at Properties/Arduino/CompileOptions.
- Added function
sayQTimeout()
in TalkieUtils.cpp. - Added example USDistanceToVoice.
- Added function
sayQVoltageVolts()
.
- ATmega2560 supported and tested
- Always set pins to input when finishing, to avoid a click.
- Added SPI compatibility by not resetting pin 11 to input if SPI is detected
- Added new constructor
Talkie(bool aUseNonInvertedOutputPin, bool aUseInvertedOutputPin);
- Initial Arduino library version
The Talkie library examples are built on Travis CI for the following boards:
- Arduino Uno
- Arduino Leonardo
- Arduino Mega 2560
- Arduino cplayClassic
Please write me a PM including your motivation/problem if you need a modification or an extension.