rubenmak / raspberry-pi-sense-hat-audio-spectrum-analyzer

python code to analyze audio spectrum using the LED matrix of the Raspberry Pi sense HAT
8 stars 5 forks source link

Issue with "audio_analyzer_wav.py" #1

Closed evant939012 closed 6 years ago

evant939012 commented 6 years ago

There was an issue with the "audio_analyzer_wav.py" file. When I first ran the code it played the wav file WAY too fast. The disco variant played it just fine though. I seemed to have found the issue, which was in the last for loop. The block of code that reads the WAV data seemed to be executing many times each time the for loop iterated, causing it to play too fast. Removing the block from the loop seemed to fix it.

Additionally the file wouldn't accept the command line input for the audio file path, but by looking at the disco file I was able to fix that easily too.

rubenmak commented 6 years ago

Thanks for sharing! I indeed see that it's an older version in which I hardcodes a wav file instead of having the argument input.

However, I don't see the difference in the _wav version and the _disco version in the last for loop immediately. I'll have a look at it later. Or, if you want, you can make a pull request, then I'll see it right away!

Thanks again for noticing the issue!