Arduino reading audio input

Hey, I was wondering if there was anyway an Arduino could read and audio input and respond via LED or something. This might be a silly question but I've tried looking on the forums and Google searching things...

Thanks for your help!

Yuo can do it by hooking a microphone up to an anlalog input, but you most liely need to amplify the signal frm the mic.

Search the forum for microphone.

Is there anyway to feed it music and have led lights turn off and on due to the tempo or something?

Thats quite another thing because you would ned to do beat detection, which equals some level of sampling the audio and analyzing it. This is a task that is a bit much for Arduinos limited memory.

Some simple audio stuff has been done.

I don't have the link present, but search the forum or google Arduino + audio.

That sort of thing can be done with an envelope detector.
This one was posted the other day:-
http://www.andregoncalves.info/ag_blog/?page_id=61

Yes sir you can via USB. i just got done with the same project. today as a matter of fact.

here are my posts on the topic

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263084743/1#1

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265843802/0#0

right now this is my code... i think there are some holes in it still but doesn't effect performance.

const int ledPin = 3;    
const int ledPin2 = 5;
const int ledPin3 = 6;
const int ledPin4 = 9;    
const int ledPin5 = 10;
const int ledPin6 = 11;
void setup()
{
  
  Serial.begin(57600);
  pinMode(ledPin, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);
}

void loop() {
  // good settings lvl:minus 1:70 | 4:150 | 6:100 | 8:100
 int lvl = 1;      // spectral range option 0-8
 int minus = 100;   // minus value from 255 for start range (fine tune lvls)
 //------------------------------------------------------------
 int total = 0;    // for calculations below. <<don't edit>> 
 int data[9];      // raw serial data <<don't edit>> 
 int value[7];    // values for the led pins based on the minus value <<dont' edit>>
 int check = 0;
 // serial data start ---------------
  if (Serial.available() >10) {
    
     byte i = Serial.read();
     if (int(i) == 255) {
       for (int c = 0; c < 9; c++){
       data[c] = int(Serial.read());
       check = 1;
       }
     }

  }

  // serial data end -----------------
  // some math -------------
 total = (255 - minus) / 6;
 value[0] = 0;
 value[1] = 255 - minus;
 for (int k = 2; k <= 5; k++){
   value[k] = value[k - 1] + total;
 }

      
// math end -----------------
 //----------- solution 1 ----------------

 if (check == 1){
  if (data[lvl] == 0){
    analogWrite(ledPin, 0);
    analogWrite(ledPin2, 0);
    analogWrite(ledPin3, 0);
    analogWrite(ledPin4, 0);
    analogWrite(ledPin5, 0);
    analogWrite(ledPin6, 0);
  }
  if (data[lvl]> value[0] && data[lvl]<= value[1]) {
    analogWrite(ledPin, 255);
    analogWrite(ledPin2, 0);
    analogWrite(ledPin3, 0);
    analogWrite(ledPin4, 0);
    analogWrite(ledPin5, 0);
    analogWrite(ledPin6, 0);
    
  }
  if (data[lvl]> value[1] && data[lvl]< value[2]) {
    analogWrite(ledPin, 255);
    analogWrite(ledPin2, 255);
    analogWrite(ledPin3, 0);
    analogWrite(ledPin4, 0);
    analogWrite(ledPin5, 0);
    analogWrite(ledPin6, 0);
  }
  if (data[lvl]>= value[2] && data[lvl]< value[3]) {
    analogWrite(ledPin, 255);
    analogWrite(ledPin2,255);
    analogWrite(ledPin3, 255);
    analogWrite(ledPin4, 0);
    analogWrite(ledPin5, 0);
    analogWrite(ledPin6, 0);
  }
  if ( data[lvl]>= value[3] && data[lvl]<=value[4]) {

    analogWrite(ledPin, 255);
    analogWrite(ledPin2, 255);
    analogWrite(ledPin3, 255);
    analogWrite(ledPin4, 255);
    analogWrite(ledPin5, 0);
    analogWrite(ledPin6, 0);
  }
    if ( data[lvl]>= value[4] && data[lvl]<=value[5]) {

    analogWrite(ledPin, 255);
    analogWrite(ledPin2, 255);
    analogWrite(ledPin3, 255);
    analogWrite(ledPin4, 255);
    analogWrite(ledPin5, 255);
    analogWrite(ledPin6, 0);
  }
    if ( data[lvl]>= value[5] && data[lvl]<=value[6]) {

    analogWrite(ledPin, 255);
    analogWrite(ledPin2, 255);
    analogWrite(ledPin3, 255);
    analogWrite(ledPin4, 255);
    analogWrite(ledPin5, 255);
    analogWrite(ledPin6, 255);
  }

}
}

  // ------------- end Solution 1
    // ------------ Solution 2
     /*
     if (value > 0) {
       if (value > 0 && value <= 175) {
         analogWrite(ledPin, 0);
       }
       if (value > 175 && value <= 195) {
         analogWrite(ledPin, 10);
       }
       if (value > 195 && value <= 215) {
         analogWrite(ledPin, 100);
       }
       if (value > 215 && value <= 235) {
         analogWrite(ledPin, 210);
       }
       if ( value > 235 && value <=255) {
         analogWrite(ledPin, 255); 
       }    
 
     }
*/
 // -------- end solution 2 ---------------

solution 1 is just a vu meter, which is what i have working right now. and solution 2 is old and needs to be updated to the current code i have in place.

video from last night:

note: the code above works smoother than the one in the video which is using the old code.

let me know if there is anything you need help with.. i'm noobish but i still understand quite a bit. ;D

Cheers,
Dave.

And if you don't need spectrum analysis or want a computer attached, I have the Shifty VU Shield: shifty_vu_shield [macetech documentation]

You can do this sort of thing: Shifty VU - YouTube
Shifty VU - YouTube

This stuff is gold. Ill have to check it out and start ordering the parts when I get home. Thanks everyone!