Go Down

Topic: How to listen PC audio realtime by Serial port (Read 569 times) previous topic - next topic

bithua4

I have an ideal, I want to make a led spectrum with source audio from my PC. I want to get audio output by USB port cause sometime I use headphone but still see spectrum.
Please point me how I can do this!

Grumpy_Mike

It would seem this is a PC problem. Getting the audio out of the PC on serial requires a program on the PC to do it. I don't see this as an Arduino problem.

Lucario448

And maybe that PC program should do the spectrum calculations and send the results to the Arduino to display them respectively.

The thing is: the AVR Arduinos may not have enough "horsepower" to calculate the spectrum and display it; I mean it can, but not at a decent framerate.
And then there is the serial port; which can't keep up at transmitting raw audio data unless an insane baud rate is used (1 Mbps and above). 115200 bps barely can deal with 8 KHz 8-bit mono audio data; and remember that lower sample rates limits the spectrum's frequency range. Sending a lossy-compressed stream (like the MP3 one) doesn't work either; an AVR Arduino has not enough power and RAM to decode the stream in real time.


So, I suggest you to only transmit pre-calculated data to the Arduino. The computer does the hardest part, then the Arduino just displays the results. A decent framerate can be achieved that way.

bithua4

Thank you so much, this is the first time I do with Arduino. So let me check this again
Thank you

DVDdoug

Quote
I want to get audio output by USB port cause sometime I use headphone but still see spectrum.
Normally, you'd use a Y-Splitter to send the audio signal to your headphones/speakers and to the Arduino at the same time.

Another way to do it is with a "pass-through" connection where you plug your Arduino box into the sound source, then plug your headphones/speakers into the Arduino box. 

Go Up