Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« on: June 24, 2010, 09:20:33 am » |
Hi! I was wondering if it is possible to make Arduino Duemilanove talk (using small speaker) without SpeakJet/VoiceBox shield? I mean just using software + speaker...
Something like this [media]http://www.youtube.com/watch?v=Eo3hEKAOxeg[/media]
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #1 on: June 24, 2010, 11:26:45 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #2 on: June 24, 2010, 01:45:26 pm » |
One other thing, since I noticed you in another thread talking about having a bunch of hardware connected to your Arduino: Most likely, when using this software synthesizer, you will find that you can't do anything else while it is running; in other words, it likely takes up a lot of CPU cycles, while also consuming a big chunk of memory. In other words, it turns an ATMega into something like the SpeakJet (which, IIRC, is simply another software synthesizer running on a custom programmed PIC). 
|
|
|
|
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #3 on: June 24, 2010, 02:49:36 pm » |
Wow, thanks a lot cr0sh and Jiggles! Gonna try it out.
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, Canada
Offline
Full Member
Karma: 0
Posts: 144
Arduino rocks
|
 |
« Reply #4 on: June 24, 2010, 08:22:38 pm » |
I managed to translate Webbot's speech synthesis code and made a simple TTS (text to speech) library. But You can't connect just a speaker to a PWM pin, you need to add a RC filter and an amplifier. I used the schematic below:  Also, the code is big and the speech is retro robot like. You can't do anything else during the speech time, but you can do whatever you like before and after the speech is done. Here is the lib: TTS.zip After download, create a TTS folder under Arduino-0018\libraries and place all files there. Then, from Arduino you can open the example provided.
|
|
|
|
« Last Edit: June 24, 2010, 08:24:12 pm by Ro-Bot-X »
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #5 on: June 24, 2010, 11:50:04 pm » |
Ro-Bot-X do you happen to have a bigger schematic? Also what components do I exactly need? - as I am a total noob, I need everything to be clearly understandable (got it) I was trying to test this code by uploading it to my Arduino board. Unfortunately I always got the same error. What is the problem? I was thinking about doing a talking clock or talking temperature meter (thermometer) or autonomous robot
|
|
|
|
« Last Edit: June 25, 2010, 04:51:56 am by Fredx »
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #6 on: June 24, 2010, 11:55:03 pm » |
Ro-Bot-X: Interesting - what's the memory footprint after the translation?
|
|
|
|
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #7 on: June 25, 2010, 12:43:44 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, Canada
Offline
Full Member
Karma: 0
Posts: 144
Arduino rocks
|
 |
« Reply #8 on: June 25, 2010, 09:23:29 pm » |
I was trying to test this code by uploading it to my Arduino board. Unfortunately I always got the same error. What is the problem? The problem is you can't follow directions. I told you in my previous message to make a folder named TTS in the libraries folder under Arduino-0018. Copy all the files there. Perhaps it's not obvious to everyone that there is a sub-folder called examples that has to be copied in the same TTS folder... Make sure the TTStest.pde is located in the examples\TTStest folder when you run it. You can't have the TTS.h and english.h tabs in your code and also import TTS.h from the library... @cr0sh: When I compile the example, I get the following code size on a mega328: Binary sketch size: 10684 bytes (of a 30720 byte maximum)
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #9 on: June 25, 2010, 09:55:19 pm » |
Well - not exactly tiny, but it still leave 20K or so available, so it isn't too shabby, either, for what it does, I suppose... 
|
|
|
|
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #10 on: June 26, 2010, 09:57:09 am » |
Ro-Bot-X.... shame on me :-[ I was too hurry that I didn't read all your post.
For now, I got it working. I connected Arduino to my computer speakers and everything works fine. Interesting is that when using VoiceBox Shield... you have to have SpeakJet Chip + TTS256 Text to Speech Chip... but you have both in one....
|
|
|
|
« Last Edit: June 26, 2010, 10:37:13 am by Fredx »
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #11 on: June 26, 2010, 10:50:18 am » |
I have one more question - is it somehow possible to use the chip from children toy mobile phone? That usually say something like "I LOVE YOU... etc"
|
|
|
|
|
Logged
|
|
|
|
|
Lancashire, UK
Offline
Edison Member
Karma: 8
Posts: 1988
|
 |
« Reply #12 on: June 26, 2010, 12:37:03 pm » |
Possibly, if you have a datasheet for the chip in question.
|
|
|
|
|
Logged
|
|
|
|
|
Europe, Estonia
Offline
Full Member
Karma: 0
Posts: 208
|
 |
« Reply #13 on: June 27, 2010, 07:21:55 am » |
Hi again, I am trying to make the Arduino to say the current temperature. I have connected temperature sensor LM35 to analog pin 0. There is something wrong with the red part./* The Text To Speech library uses Timer1 to generate the PWM output on digital pin 10. The output signal needs to be fed to an RC filter then through an amplifier to the speaker. */
#include <TTS.h>
// Media pins #define ledPin 13 // digital pin 13 const int pin = 0; // analog pin 0
int tempc = 0; int tempb = 0;
// Variables char text [50]; boolean state=0;
TTS text2speech; // speech output is digital pin 10
void setup() {}
void loop() {
// Takes 8 samples and sums up for(int i = 0; i < 8; i++) { tempc += analogRead(pin); }
// Makes some calculations tempc = (5.0 * tempc * 100.0) / (8.0 * 1024.0); int tempb = tempc + 0.5;
state = !state; Test_Speech(); }
void Test_Speech() { text2speech.setPitch(6); //lower values = higher voice pitch strcpy(text, tempb); text2speech.say(text); delay(500); }
int tempb = tempc + 0.5; gives the temperature numbers, like 23 degrees. ----- strcpy(text, tempb); text2speech.say(text); should say the value. This works fine: strcpy(text, "Hello there 1 2 3 4 5"); text2speech.say(text); But i want it to say the int tempb valueI think there is a problem with text and integer..
|
|
|
|
« Last Edit: June 27, 2010, 07:29:52 am by Fredx »
|
Logged
|
|
|
|
|
Nottingham, UK
Offline
Jr. Member
Karma: 0
Posts: 90
Wait! Don't touch that wire...
|
 |
« Reply #14 on: June 27, 2010, 07:36:43 am » |
The strcpy is bad. You are trying to copy an int to a string. There are int to string conversion functions to use instead.
|
|
|
|
|
Logged
|
|
|
|
|
|