I'm not sure if it's doing anything...it mostly fluctuates around 980. Is that getting the pitch or is it getting volume? I just have the code doing a digital read of the input. And then I am reading from the serial monitor what number it gives. If it is the pitch, what is the threshold? The goal here is to essentially make a tuner, based on hertz, not oscillation.
a digital read? That's only low/high 1/0. The fluctuations of the electret are analog. You have to put it in an analog input.
The signal of the electret may be too small to work with arduino, in the range of the millivolts. You should amplify in to the 0-5v range:
Googling fast i found this image http://fritzing.org/media/fritzing-repo/projects/e/electret-mic-opamp/images/Fritzing.png i didn't test it.
And the mic doesn't give you any information on the pitch or frequency. Higher voltage = higher amplitude, not higher freq.
To determine the frequency you have to use the FFT library for arduino
Is that getting the pitch or is it getting volume?
Neither... It's the instantaneous amplitude at one moment in time. It's sort-of related to volume, but only if you happen to catch the "top" of the waveform. What are you trying to do? What kind of information do you need?
Sound is a pressure wave. The microphone converts sound pressure to an electrical signal. The sound wave goes positive & negative (like waves in the water go above and below the average or still-water level). The electrical signal from a microphone also goes positive & negative. Since the Arduino can only read positive voltages, the SparkFun board I linked to above puts a 2.5VDC bias on the signal. With this board, silence will read about 512 on the Arduino ADC. A "maxed-out" 5V peak-to-peak signal will have readings between zero and 1023.
When you read an audio signal "randomly", you don't know where you are in the waveform... You can read anything between the positive & negative peak. You might even read zero (or 512 if there is bias) if you happen to take a reading at the waveform zero-crossing. If you want to read "loudness", you need to take lots of readings and pick the biggest reading to get the approximate peak of the waveform. Again, it's like measuring waves in water... You can't just stick a measuring tape in the water and take a reading at any-old time... You have to wait for a wave-peak to come-along.
If you also need the pitch information, you need to read at known time intervals to know the timing of the waveform. For example, CD audio has 44,100 samples (readings) per second. [u]Here[/u] is a basic introduction to digital audio... Basically each sample is a "dot", and an analog-to-digital converter can "connect the dots" to re-create the analog waveform.
That is a very difficult thing to do with any real world sound input.
Take most instruments, the fundamental is often lower than the harmonics and they change over time so getting the exact pitch is very hit and miss.