Audio signal on arduino (Trying out something for a LED project)

I want to create my own project of addressable Leds usage (also led stage lights using dmx512), and I find a problem with every code and project I have encountered.

Basically almost everyone of the few projects I have found on this topic uses a sound sensor to capture the sound, but I find it quite annoying, I dont wan't the leds to be disturbed by the sound in the room being captured through a microphone, I wonder if I could get the audio signal from the pc or smartphone, trough jack , bluetooth, rca or anything else but a microphone really.

That way I couldwork with frecuencies and that stuff based only on what's being played by the media player (spotify in this case).

Is anything of this possible? If so, how? If someone were able to link me to some post regarding the audio matter in arduino I would be extremely grateful.

(P.S: Sorry if I misspelled something, I'm not english and thank you in advance)

Of course. The analog inputs of the Arduino are general purpose, and commonly accept input from thousands of applications using almost that many different analog sources.

Check this thread

The Arduino can be damaged by negative voltages (and it can't read negative voltages) so you shouldn't directly connect the audio (AC). And if the Arduino isn't damaged the signal can be "damaged" (distorted).

There is a schematic at the bottom of [u]This Post[/u]. It's just a voltage divider (2 equal-value resistors) to bias the input at 2.5V so you can read the negative half of the waveform, plus a capacitor to isolate the bias from the audio circuit.

It works pretty well with line-level or headphone-level signals but you might need amplification if the volume isn't turned-up.

If you just need "loudness" (no frequency detection) you can use a [u]Peak Detector[/u]. It's more complicated but there are a couple of advantages - You're getting a varying DC voltage so you can just read the level about 10 times per second (or so) instead of sampling the audio signal thousands of times per second. And, since it ignores the negative half of the waveform you don't need bias and you can use the optional 1.1V ADC reference for more sensitivity (with weaker signals). With my "real" lighting effects I use a peak detector and switch automatically between reference levels depending on signal level.

...I power the op-amp with +/-12V so I can get the full 0-5V swing (if needed) and then I add a protection circuit (resistor and diode) so I can't send more than 5V into the Arduino.

Or if you want frequency information and you can live with 7 frequency-bands or less, consider the [u]MSGEQ7[/u]. Again, it takes a big load off the processor because you're just reading DC voltages representing the strength of each frequency-band.