Hummm, I wonder how fast is the max sample-rate of the analog input...
Depending on what he wants to do, there's no need for much memory. In any event, a cheap FLASH or EEPROM 2-wire chip could do the trick. Just don't know what would be the rates to record and read from those.
Hummm, I wonder how fast is the max sample-rate of the analog input
That is fine, it's not the problem.
You can't write to flash or EEPROM fast enough, especially over the i2c bus. You might just get away with SDRAM on i2c running at 400KHz but you still have the output side, PWM doesn't hack it.
Basically 9.6 Khz is enough for me, telephone quality is acceptable for this project.
I don't need to store the voice recorded but just "route" values from the analog in to the speaker.
Something like:
val = analogRead(..);
analogWrite(val,...);
My confusion is actually on signals and the pin to connect.
Microphone must be amplified and connected to an analog pin, but I don't know how to connect the speaker (PWM ?)
and how to convert analog values read from microphone to something useful and correct to write on the speaker pin.
MIC --> OP AMP --> ANALOG IN (?????) PWM --> SPEAKER
I don't need to store the voice recorded but just "route" values from the analog in to the speaker.
So why have it going into the arduino in the first place, surely a piece of wire would do.
Analogue in returns a 10 bit number, the PWM needs only an 8 bit number so you have to convert the sample between reading it and spitting it out. Something like
analogWrite(13, analogRead(0) >> 2) ); would do it.
I don't need to store the voice recorded but just "route" values from the analog in to the speaker.
So why have it going into the arduino in the first place, surely a piece of wire would do.
Analogue in returns a 10 bit number, the PWM needs only an 8 bit number so you have to convert the sample between reading it and spitting it out. Something like
analogWrite(13, analogRead(0) >> 2) ); would do it.
Eh eh eh I'm studying this to get in confidence with different kind of signals.
Next step is to send the read value to another arduino via radio to play the voice with a remote speaker.
My Last project (when I was a student) using a PIC record sound from a mic and the phone line the pic buffered it and streamed it to the PC.
I used a 20Mhz Crystal and were able to get 12Khz.
The Microphone Amplifier
A LM324N a low-cost operational amplifier is used to amplify the microphone to an audible level. Two stages are used the first stage gives a amplification of +- 45 (R7/R2), R5 is set to +- 22K? and the second stage give an amplification of +- 22 ((R9+R5)/R8). The two stages combined give a total amplification gain of 990. R3 and R4 provide a center voltage of 2.5V for microphone and is connected to the first stage. C8 only lest the AC audio signal through. R11 and R12 provide a center voltage of 2.5V which is connected to the ADC input on the Microcontroller.
I don't remember, it was a pic18F2550, I buffered 32 bytes at a time to the PC and the PC saved all the bytes, when the recording was done the PC converted it to a WAV file.
The PIC only streamed the audio to the PC.
I wroted code in C Builder to write the buffer to a file and then used a WAVE Module by Timothy J. Weber. to conver it to a wav file,
I did the project in 2007 You will have to goolge for the module.
That chip has a USB 2.0 full speed interface on it, is that how you were able to transfer so much memory so quickly?
Remember the arduino only has a serial port.
I used the CDC Class (128000 // baud rate) and not the full USB on the PIC, Because I used a serial driver on the PC It looked to difficuled to use full USB and I did not have a lot of time to complete the project.
Guys I havent read everything here, but this is more than possible. Using an AVR I stream straight out of a pwm pin 8KHz wav files stored on an sd card. It was reading the data into a buffer, while sending the values of a second buffer full of wav file to pwm0. Worked like a charm