Saturday, April 19, 2014

Light Show Now On Ubuntu

So my previous set up was pretty janky. If you've read my previous post, I had a win32 program using some APIs to get an audio stream, process the data and write "peak" values to stdio. This was then piped into a Python script which calculated the LED string colors and wrote them out serially using PySerial.

I re-wrote the audio capture code in Python using PyAudio. This is much cleaner now as the whole thing can be done in Python, and it works on Ubuntu!

I also had some graphics plotted really badly using win32 APIs. I rewrote that section of code using matplotlib so it looks much nicer now and is more responsive.

4 comments:

  1. Great work man, I want to use this code spectrum.py and the audio module you have. I refuse to use it at the moment because I don't completely understand it. It takes me a while to get my head around certain things! Is there a chance you could do a line by line walk through / tutorial on the audio visualizer for simple folk like me ?

    ReplyDelete
    Replies
    1. Is there a specific part of the code you're having trouble with? I will probably do a cleaner re-write of the code with some better comments, but unfortunately it will probably be a while until that happens.

      Delete
  2. Where can i download the source code of this? Please!

    ReplyDelete
    Replies
    1. https://bitbucket.org/htonoyan/audio-visualizer

      Delete