Hi,
I'm trying to achieve audio recording and playback with the Arduino. Of course, I don't expect a very high sound quality, but right now what I get just doesn't work at all.
For now, I followed the advices in the following post: http://a.parsons.edu/~chainreaction/?p=143, so I tried pluging my laptop headphones output in the Arduino. It seems to be partially working: I can see the value from analogRead() change when there is sound. With the following code, I also get "something" from the output that is a bit like the input (although its very noisy):
Here is my code:
#define AUDIO_INPUT 0
#define AUDIO_OUTPUT 9
int audioIn;
void setup() {
pinMode(AUDIO_INPUT, INPUT);
pinMode(AUDIO_OUTPUT, OUTPUT);
}
void loop() {
audioIn = analogRead(AUDIO_INPUT);
analogWrite(AUDIO_OUTPUT, audioIn);
}
The problem I seem to have now is that the sampling rate of analogRead() seems to be very slow according to the following post: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1167113121/9#9. It seems to take at least 1 ms.