Mic input and Speaker output using arduino, NOTHING ELSE

I am trying to make a small project. Firstly, I want to record voice using a small microphone(electret) for the time button is pressed and on releasing the button, the speaker of my laptop should output the recorded voice or a speaker attached to the arduino should output the recorded voice.

Note: I don't want to use any shield to do so. Simply Arduino

It would be fine if the voice is not recorded and just a mic system is created which will not record sound but output it as it is input at the same time.

Recording time on an arduino uno is less than a quarter of a second.

It would be fine if the voice is not recorded and just a mic system is created which will not record sound but output it as it is input at the same time.

That is possible but a bit pointless and the quality is not very good.
It is very simple to do however:-

void setup(){
}
void loop(){
analogWrite(3,analogRead(0)>> 2);
}

You will need a speaker or earphone with an impedance greater than 100 ohms.

It would be fine if the voice is not recorded and just a mic system is created which will not record sound but output it as it is input at the same time.

For that you can use an [u]Amplifier Chip[/u]. You don't need a programmable microcontroller. You'll probably want one where you can adjust the gain. You'll need a gain of around 100 (40dB) depending on how loud the sound hitting the microphone is and the sensitivity of the mic. Then, you may want to add a pot at the input to adjust the volume.

Typically, you'd have 2-stages, a preamp to boost the microphone signal (millivolts) to line level (about 1V), and a second "power amplifier" stage to drive the speaker(s). But, you can probably get enough gain with a power amp chip.

BTW - You also need a preamp with the Arduino (or a microphone breakout board with a mic and preamp).

It would be fine if the voice is not recorded and just a mic system is created which will not record sound but output it as it is input at the same time.

Is there some reason it has to be an Arduino?

An LM386 with a capacitor between pins 1 and 8 has a maximum voltage gain of 200 (46dB) and will amplify a high impedance microphone like an electret or piezoelectric sufficiently to drive a speaker.

Not really enough voltage gain for a low impedance microphone. But you probably aren't using a low impedance mic.

Is there some reason it has to be an Arduino?

Homework?

That occurred to me after I hit Post.

You can`t do it without some extra hardware to amplify the mic input.

Firstly when i am only trying to connect a speaker only to the arduino then there is no output. I am using this link http://arduino.cc/en/tutorial/tone.

Then you are doing something wrong.
It is hard to say what because you have not told us exactly what you have done.
If you had done what is in that link then it would have worked.
How about a photo of your setup?

The circuit is the same as that in the above link and its not working so i was thinking that the speaker might be out of work!

so i was thinking that the speaker might be out of work!

Connect the speaker and resistor between the ground and the 5V line if it clicks then it is OK.

i was thinking that the speaker might be out of work!

An unemployed speaker!

hi , i have made the same circuite of microphone with pre amplifier of LM386 op amp for voice recording with arduino mega 2560

i have tested my pre amplifier circuite LM 386 with a 4 ohm speaker as you guys mention in the above circute
i am getting too much noice with some voice and how to reduce this noice

and another thing i feed this pre amplifier LM 386 output to a post amplifier TL072 in put, in this case i just wanted to test post amplifier TL072 output with a speaker , how can i do that

i'm doing a project with arduino too, a telecommunication device, so a person can talk into a mic and another person can hear from another arduino at the same time. can arduino uno handle voice input? i think need some sort of ADC and DAC, but not sure uno can handle?