display 2 different images, per sound level, on my desktop using p5js
It probably makes more sense to plug a mic into your soundcard... That way you' won't have to build any special/custom hardware. And, you'd only have to program one device (the computer).
Or with a laptop, you could use the built-in mic.