I am trying to find a way where I can play music on my computer and have the arduino software make LEDs light up in a way based on the sound. I don't want to use an external microphone because I want to be able to make other noise in my room without it messing up the LEDs. Is there any way to get values from my computers audio in real time? Thank you!
The first questions you have not answered is what is your computer, what is it's operating system, and what is your experience with writing programs to run on your computer?
I'm running Windows 10 on laptop. I don't have experience writing in Arduino. This is one of my first projects.
Your laptop may have a speaker or line out analog connection - I’d look into using that.
- it might turn off the internal spkr tho
- you need to measure the voltage levels.
- the output will be AC and will need to be modified , you may need op amps etc.
You can then use amplitude to trigger an Led(S) , splitting up
Bass from treble etc is a lot harder
Google “ Arduino VU meter” or “ Arduino sound to light” for inspiration
- however …not sure what you mean by converting to code
My assumption was the OP wanted to get some kind of values from the sound card. So the PC program would be necessary.
Try Googling "Arduino color organ" and see if that's the sort of thing you want. Plenty of instructions out there for building one of those.
I’d look at the Audio Library created for the Teensy family of processors. It has an input object that can receive audio from the PC over USB. You can then process the audio in many ways using other objects from the library. You could drive the LEDs based on output from an FFT, Peak Level, or RMS analysis. There are also objects for filtering and special effects.