SpeakJet back to Arduino?

Hi,

I successfully installed my SpeakJet near Arduino so that it speaks what Arduino says, by using available tutorials. So currently sound commands are being sent by Arduino to SpeakJet and from there the generated signal comes out of speakers.

Now I wonder, what is the best approach to set up:
SpeakJet <----> Arduino <----> PC
So that the role of Arduion will be only driving the SpeakJet, and handing back the generated sound to PC?

The trivial way which comes to my mind (theoretically) and I think is one of the worst ones (giving an awful quality) is getting the sound from the output of speaker, resample it back and give it to Arduino, but there must be wise solutions, I hope Gurus give me a hint to :smiley:

Thank you!

Sorry for unclear writing, I'll now try to better explain:

The phonemes are being sent by Arduino to SpeakJet and I hear them from speaker. Now I want to try to have the output of SpeakJet as a recorded mp3 in my PC.

I tried it in trivial way: made SpeakJet to say something, took a microphone close to speaker and executed software on PC to record mp3. The result was unacceptable.

I want to have the "generated voice" back to my computer as mp3, but by a better solution than to keep a microphone close to speakers which are connected to the SpeakJet.

Another possible solution:
Have PC to send the phonemes to Arduino, from there to SpeakJet, the generated sound from SpeakJet comes back into the PC sound card and get into the PC from "line in", and recorded by a software.

Hope I'm clear with the idea this time?

First of all, these projects I do to learn more, so I choose scenarios which are getting more complex to learn something. My dream in this project is to learn to write a driver for printer port, so that the sound signal enters to, and is encoded to mp3 or ogg by my driver (dream to write both under Linux and Windows).

Now manufacturing a scenario to justify the project:

Suppose I am not beside the speakers of SpeakJet, sitting on another machine in the internet, but have set up Arduino serial connection with my lovely router WRT54GL and can send phonemes remotely to Arduion. To try to get an acceptable pronunciation for a word, I have to be able to listen to it. In this case, the only way for me is to have the feedback in mp3 form, listen to it, alter phonemes for a better sounding, and send the command back.

Now I see the easy approach to start with is:

  1. get the line in of sound card as input from speak jet
  2. record mp3 with (googling) an open source program to learn

To make it harder, I have to go for parallel port.

Does it now make sense if the educational purpose is in it?

WOW thank you)

Very nice starting point, actually I have no question about the software part but only of electronics, and you pointed me to just what I need :smiley:

Fortunately, I have a PC which has the parallel port and I am also going to make a programmer on it to write bootloader of Arduino to my Atmega chips.

So, "theoretically" there must be no problem...no difference in theory between theory and practice, big one in practice :smiley:

Thank you again)

Something to keep in mind:

The SpeakJet is nothing more than a custom-coded PIC microcontroller, according to this:

http://www.redcedar.com/sc01.htm

In theory, you could do the same with a ATMega - in fact, it has been done:

https://code.google.com/p/tinkerit/wiki/Cantarino

So, while you wouldn't be able to easily (or possibly at all) modify the PIC code on the SpeakJet to output the direct digital samples (instead of the audio PWM) - which could then be passed on in some manner to the Arduino and then back to the PC, it should be possible to do so with the Cantarino.

I am not sure what the quality of speech is between the Cantarino and the SpeakJet; also, I am not sure if the Cantarino has an easy-to-use serial interface, or if that is something you would have to hack in place (I suspect the latter).

I imagine all it would take is some hacking of the Cantarino code with the NewSoftSerial library (or similar), plus glue code for the serial interface protocol interpretation. Assuming there's room in RAM for the code and variables needed, that is.

Hmm - now I am wondering about timers, and whether Cantarino can be expanded the way I was pondering.

Cantarino (the demo) uses Timer2 on the Arduino (Timer3 on the 1280); if you set up a serial interface with it, you would need to incorporate NewSoftSerial - but I can't seem to find a good reference as to which ATMega timer it uses. Also - does the standard serial port use a timer? IIRC, it does; I want to say Timer0?

Maybe you could interface via I2C to the second "Cantarino"-based synth ATMega...?

Actually - what am thinking? Just use the hardware serial on the Cantarino-based synth ATMega! Duh...

;D

[edit]Hmm - and it seems that NewSoftSerial uses Timer0...[/edit]

[edit]And the hardware serial doesn't use a timer?

Do I have this right: Hardware serial doesn't use a timer, NewSoftSerial uses Timer0 (same as millis() and delay()), and the Cantarino software demo uses Timer2?

:P[/edit]

The idea is really interesting - to get a PIC or Atmega chip to work as SpeakJet - but far from my knowledge still...I think that needs a sound understanding of DSP at least, yet lower than simply coding something.

I'll first try to learn these elementary tasks like driver for sound card to get the sound out of the circuit that was suggested above. If I could pass them then turn to DSP (I have good books, and my math background is not bad).

Anyway, thank you so much for giving me clear perspective for my project. I've small confusions on electronics suggested in this post, but I'll ask of if I can't figure it out by some returning and rethinking.

Thank you!